So you've got Hogwarts, with several hundred adolescents obviously suffering from raging hormones, living in sexually integrated housing, and the incidence of hanky-panky beyond snogging is apparently zilch. Huh? How can this be?
The out-of-canon answers are more than adequate:
JKR simply didn't want to write That Kind of Story (and I'm not convinced she could have if she tried). The author's choice is final.
Adding sex to the mix would have complicated the story horribly.
Adding sex to the mix would have cast the moral incoherence of the wizard world into unbearably sharp relief.
JKR's core readership (preadolescents) wouldn't have stood for it. The cries of "Eeeeew!" would have been deafening. And the sales would have reflected that.
As far as I know, JKR dealt with the whole thing by simply and comprehensively ignoring it, so there's not likely any explanation within the books (although I could be wrong). Is there a mention of a "Sal Petrus" spell worked into the wardings of Hogwarts?
So. Has the subject come up? Has anyone had the chutzpah to ask JKR?