Now, putting the issues with gender discrimination and how to deal with sex crime aside, here are some ways in which I could see a world where chastity is dictated by policy:
1) Institutional policy. Basically, though there is no law mandating chastity, several institutions (e.g. colleges) might mandate the wearing of chastity devices as a condition of enrolment. While claims that it would reduce distractions are quickly revealed to be false, it did cut down significantly on people who regret drunk sexual escapades.
2) Ya got a loicense for dat? Imagine like just how we require people to demonstrate that they are able to use their motor vehicles and firearms responsibly before we let them handle those in public, people were required to prove their ability to behave responsible sexually before they were allowed to go out in public without a chastity device on.
3) Cultural tradition. Again, no laws mandating any of that, but wearing a chastity belt might be a social norm. I will not start a discussion of starting age here, but wearing your first chastity device might be a coming-of-age right, and young adults living with their parents would have their keys held by them, married people would typically have their keys held by their spouse (to guarantee and demonstrate marital fidelity - this is not necessarily an act of submission, so mutual keyholding within a couple might be totally in line with the tradition). As for singles living on their own... either an older family member living nearby, or a trusted authority in the local community or a community-appointed guardian or something along those lines that ensures the wearer can keep themself sanitary without unchaste behavior. I am kinda getting the mental image of a medieval village where the priest is simultaneously teacher and therapist as well - in a more modern, religiously pluralistic setting something like a medical clinic or something could come to mind.