Before World War II, most secondary education was segregated by gender. Catholic high schools and boarding schools were single sex almost universally, and many public high schools maintained separate campuses for boys and girls. Additionally, there were far more men in the teaching profession. Our forebears were wiser than we are.
In the teen years, if you put boys and girls in close proximity, it will seriously distract from schoolwork.