What follows is obviously only one side of the story, so I’m reserving judgement on this particular case, but I am an atheist, not an antitheist, so I am firmly on the side of freedom of religion.
If this is an accurate representation of the facts, the teacher went full jerkstore. Bullying children is a shit thing to do. One can challenge beliefs without being a jerk about it. And arguments are often more effective when you’re not putting people into a position where they feel the need to defend their identity.