It's not nonsense. Some people are born intersex. How would you insist they defined themselves?
Society has deemed that gender roles are binary, despite biological sex showing that this is not actually the case.
Ultimately the key issue is the quality of education the children are receiving. It doesn't actually matter how someone identifies. It doesn't matter what name they ask to be called. Everyone deserves the respect of being addressed how they choose.
The teacher is not telling children that their lifestyle is something that should be followed, or that is the right one, just that this is their preference.