Because law treats it as a contract. You don't consent to it, it is rape. You consent to it, then you can't charge the person with anything.
Contract - Wikipedia, the free encyclopedia
Considering that consent to sex is a legal agreement (as seen by the ability of law to withhold it from persons), and it is enforceable in law (if there is consent to sex, then there is no ability to charge for rape).
If one wanted to, one could say there is a contract between all persons to not have sex with each other (breaking this contract is punished via the crime of rape), and that we may willingly, in pairs (or great numbers), suppress the contract momentarily, but only in some cases.