School district launches investigation after teacher encouraged students to pledge allegiance to Pride flag