But there are under-age sex laws which are in place to protect those who are under a specific age against position of trust, and generally being more naive. I'm not saying all people under the specified ages - 16 for example, are naive or easily led, but there are a lot of children/teenagers out there who are.
Saying that because they are together for 6 hours a day (which isn't true in many cases - a 19 year old will be learning more advanced levels of education than a 14 year old, to put them together simply does not make sense in a fully productive and working educational facility.) means that there is no problem with it or that it is because 'we don't separate the ages in education enough' is just wrong, sorry. It just suggests that we are unable to control our urges, whether right or wrong.
Does that mean that guards should be able to become friends, and from there to become more with the prisoners, because they are put together for longer than six hours a day, because we don't separate them enough?
A teacher will spend many hours a day with a student, does that mean that there is no problem with them becoming more? Sure, after they do not hold that position of trust and the student is over the legal age (whether moving schools or the student graduating from the school), but there are reasons the laws are in place and that explicit relationships involving a minor is classed as statutory rape. For the protection of the youth.