We still have single sex halls and there are charms preventing oppostite sex access.
Except for the cleaning ladies and the bledlows of course.
But as they're not magical it doesn't matter.
In addition there is a Dorm Mistress (somewhat akin to Mrs. Ludlow) and a Dorm Master.
Even a wizard knows not to cross them or the bledlows and the maids.
Too many things can go missing otherwise.
Especially as there's a meagre five courses at every meal.