It's not that it has a deliberate sinister meaning @Justsomethoughts
It's obviously an off-hand comment that the teacher has not really thought about.
The problem is adults not thinking about these things, about what you are saying to children and how they are hearing it.
A teacher calling some girls beautiful, but not boys, reinforces sexist values that girls should strive to be 'beautiful' but boys don't need to worry about it.
As a child, if you see your teacher calling other girls beautiful, or you are called beautiful, then you think that's a good thing for a girl to be, and you start caring more about your physical image/ wanting to be seen as beautiful.
It's not 'sinister', it's just subtle, unconscious sexism.
If people thought about what they are saying a bit more, we might not have such a problem with teenage girls hating the way they look, developing anorexia, social media bullying etc etc.