Public schools have a legal obligation to keep preaching out of classrooms and to treat all students with dignity and respect. That failed to happen recently in Cedar Hills, Utah, but the good news is that school officials acted quickly to make things right.

According to various media accounts, a substitute teacher at Deerfield Elementary School was in a fifth-grade classroom a few days before Thanksgiving and asked students what they were thankful for. An 11-year-old boy who has been referred to as D.M. to respect his privacy said he was looking forward to being officially adopted by his two dads.

The substitute, whose name has not been disclosed, went ballistic. Other students reported that she replied, “Why on earth would you be happy about that?” She then reportedly harangued on the topic for 10 minutes, telling the 30 students in the classroom that “homosexuality is wrong” and “two men living together is a sin.” The Salt Lake Tribune reported that she looked at the boy and said, “That’s nothing to be thankful for.”

Three girls in the classroom asked the sub to cease making such hurtful comments. When she refused, the young women left the room and went to the principal’s office, where they reported what was going on.

The substitute was escorted from the school. Reportedly, she continued to spew anti-LGBTQ venom even as she was being led out of the building.

The incident came to light after Louis van Amstel, one of the boy’s dads, posted about it on social media. Van Amstel, a professional dancer who has competed several times on “Dancing with the Stars,” has a large following online, and the story soon went viral.

He later gave an interview to the Tribune, remarking, “It’s absolutely ridiculous and horrible what she did. We were livid. It’s 2019 and this is a public school.” Van Amstel noted that he and his husband, Josh van Amstel, moved to adopt D.M. after the boy experienced two failed adoptions.

The good news is, the substitute isn’t likely to get an opportunity to do this again. Kelly Services, a firm that provides subs to many Utah public schools, terminated her. “We are concerned about any reports of inappropriate conduct and take these matters very seriously,” the company said in a statement.

Good for them. Officials at the school also deserve thanks for their quick action. But the biggest kudos of all belong to the three girls who stood up for their classmate – they’re the real heroes of this story.