What can teachers provide, besides content? What moral guidance, what emotional support, generally associated with family of origin? To answer this question, I will consider the literary/media/cultural examples of teachers as parental substitutes. Teachers are an imperfect but effective antidote to the tragedy and loneliness young people often experience.
Often in literature, film and television youths who are orphaned or in any way abandoned or mistreated by their parents often look to a teacher or mentor to fulfill the gap of parental authority.
In some variants of Arthurian legend, the young Arthur is removed from his family to be trained as a king. A daunting prospect, it is made more palatable by the fact that he’s protected and guided by the wizard Merlin. This magic-as-life-lesson trope is replicated in the relationship between Buffy (the Vampire Slayer, as much The Chosen One as Arthur) and Giles. Buffy has an absent father, but her high school librarian Rupert Giles is her Watcher (i.e. protector) and excellent substitute father figure.
Similar examples abound throughout the culture. Cinderella’s fairy godmother—a sharp contrast to her wicked stepmother—provides and cares for her. Plus, in the original legend she was the literal ghost of Cinderella’s mother. While not quite a teacher, she nevertheless possesses magical powers and so is Cinderella’s “superior” and metaphysical guide.
There are also less dramatic examples wherein the parents haven’t completely abandoned the children, abused them, or died, but teachers nevertheless serve as more than just that official role. In the children’s sitcom Boy Meets World, the protagonist Cory has loving and involved parents. Nonetheless, his exasperated but attentive teacher Mr. Feeny consistently provides him with logical insight and academic discipline his parents do not. This is a far more optimistic take on the teacher-as-parent phenomenon, suggesting a communal “it takes a village” mentality in which there are multiple positive influences in a child’s life.
Why is this phenomenon so common in fiction? Perhaps to reassure the audience—and writers—who need parental love the most that their lack of good parents doesn’t preclude them from receiving good parenting. Also, the metaphysical aspect of some of the stories might dull the sting of prospective death, as if to say, the magical knowledge and protection these teachers/parental figures imbued you with will stay with you forever. By making it so that the lesson has magical resonance, the implication is that the bond doesn’t die with the teacher.
To make it literal, if there is something “magical” about knowing philosophy/mathematics/French etc., you’ll always be bound to the people who gave you that gift, regardless of whether they themselves remember doing so. For atheists especially, or those who don’t believe in an afterlife, there’s something infinitely uplifting and reassuring about that. The concept that “his work lives on in you, his essence is preserved in your mind-- in more than merely a poetic way"-- is older than the Christ mythos.