Madness. I went to a mixed sex boarding school and they went to incredible lengths to keep the girls and boys out of each other's dorms including expulsion on the second or third offence (or first but with another offense like smoking or missing curfew).
Students who were over 17 could visit each other's room, but only in the final trimester of the year, with a signed parental waiver, the dorm room door open, and "four feet on the ground." There were some other stipulations like visiting hours, I think it ended at 6pm.
This was 20 years ago so not a lifetime ago. The rules were so strict they're etched into my mind!