There is a fantasy trope dealing with the chaste person--- usually a female virgin--- who has a degree of magical power which will be lost if the person becomes unchaste/loses virginity. In our Britney Spears culture, it's not at all to be wondered at that this trope is not in common use.
In Marion Zimmer Bradley's Darkover, there is some talk that a Keeper--- the leronis (sorceress) who is at the center of a magical/psychic working--- must be a virgin or terrible things will happen. In later ages of Darkover, a Keeper must only be chaste while she is actively working as a Keeper.
The cultural origins of this trope may go back to the pagan religions of antiquity. The Romans had their Vestal Virgins, whose purity was seen as a spiritual protection for the Roman people. The penalty for a Vestal who had been unchaste--- and her male partner--- was savage. This was because people literally thought that the unchastity of a Vestal would cause disaster--- it was possible, they thought, that dozens of Romans would die in a lost battle or natural disaster as a result of Vestal unchastity.
The reality behind this fantasy trope relates to the real-life consequences of unchaste behavior. The best modern example is the way the AIDS virus spread through the gay male community.
Once the AIDS virus spread to a few of the gay males in the USA and Western Europe who were heavily involved in massive unchastity in sex clubs or bathhouses, it spread through that group in a frightening way. Young men in gay-mecca communities in LA, San Francisco and New York City watched in horror as 10, 25, 50 of their friends became ill and died of a new unknown disease. While the most sexually active men were (and are) at most risk, even a man with only one sexual partner might get it if his partner had ever been unfaithful--- or if he'd had an infected partner before the relationship began.
People heavily invested in the sexual revolution don't like to hear this, but a little self-control in one's private behavior really does keep some of the real-world monsters at bay. And that may be what encourages a few writers to explore chastity themes, and to use fantasy tropes such as that of the chaste person with enhanced magical power.
One can use it in various ways. Does a person have to begin magical studies while still a virgin to get the best results? Can one use rape to deprive a sorceress of her power? Does the Dark Lord send his minions out to buy untouched poor children in order to have a good supply of virgin sacrifices? Or are there mere rumors and false ideas about the necessity of virginity that must be overcome--- as when a young rape victim is denied the right to study magic because she could never learn anyway, now....