ok. the way I tend to think about this is power imbalance in a relationship.
Its not wrong to feel some attraction towards a teacher, thats some feelings you can't really do much about. However it is wrong to be in a relationship with a teacher where that power balance comes in.
So if you have one schoolkid, a teenager with no adult experience, limited freedom to get out of a bad situation. That person should not be getting into a close relationship with someone who has such great ability to control them. Think of the power a teacher could have over that student, for example if their parents trust the teachers word they have an immense ability to do harm with very few places the student could go to help.
Where I am in the UK our law on sexual offenses is very explicit on this point when it comes to sexual relationships. basically no sex if you are in a 'position of trust' over someone under 18, even if by pure age limits it would be seen as ok.
Because tehse relationships are generally bad and dangerous to the younger party we discourage them, but sometimes that gets translated as saying its wrong to feel that attraction, which is not really the point.
with regard to platonic relationships I guess the same thought would apply. It is not a good idea to treat a teacher as a friend in the same way you might have schoolfriends, that person is a grown ass adult and can exert a lot of power on a naive student. But to just think that a teacher is decent and you would like that sort of person as a friend or companion is not some moral failing.