When at school, educators have a responsibility that is referred to by the courts as “in loco parentis” or “in place of parents”.
I believe teachers are there to teach, but to some extent they do perform the roles of parents by caring for the students. Teachers perform this role by preventing injuries and fostering strong trust relationships which leads to some students seeing their teachers as parental models while in school.