When I was a kid, I was friendly with all the older folks on my block. I would stop by (often alone and unsupervised) to check out books, cars, rocks, etc and learned so much. Nobody thought anything of it.
Today we are so far gone as a society that we automatically assume predation when older people interact with children. Any decent adults are too terrified of being accused so only predators remain.
I think this increases the divide between generations and is making young people even stupider.
But back in the day, there were also hundreds of written and unwritten rules of etiquette that kept people from committing social errors. Both men and women were warned against "giving an appearance of impropriety" by interacting with a member of the opposite sex in various contexts. Certainly this teacher should have known he was way over the line, unless the 42 texts were just brief, innocuous sentences about a school assignment. But why would they have been, when the mother, apparently having discovered them, called the police at 3 AM?