The Mishnah in Kiddushin (4,12-14) outlines the laws of Yihud. While the Toseftah provided in #14 warns in general about teaching "his son a woman’s trade", the only profession that is explicitly prohibited for singles is teaching the written Torah to kids in #13:
לֹא יִלְמַד אָדָם רַוָּק סוֹפְרִים
An unmarried man must not learn to be a teacher.
I understand that many professions require/allow for Yihud in a woman's house (a peddler) or a man's house (a carpenter). But for a teacher the kids always present, so there can be no Yihud anyway.
Is teaching Torah the worst profession Yichud-wise? What was so special/dangerous about it in their times? Does it still hold Halachicly?
Note, I don't question the Mishna's ruling, I ask why teaching is worse than others.