Do they have specific rules at the academy, that does not allow sex between students?
Possibly a deal with the man being in a position of authority over the woman, like an upperclassman.
Short answer to your question is, Yes there are specific rules disallowing any sexual or conjugal relationships between midshipman, enlisted or officers.
There are rules which specifically delineate the sexual encounters between midshippersons. It is painfully evident that these two did not adhere to the requirements laid down by their wise and worshipful superior officers.
"Sex between midshippersons shall be accomplished in an orderly and military fashion. The male shall maintain a constant attitude of attention and the female shall heartily sing the milspec chorus of "Anchors Aweigh."
"The only authorized alcohol that shall be consumed during orderly and military sexual encounters is "Anchor Steam Beer."