this costume , which was worn by people of all social classes and genders , allowed its wearers to be anonymous , which in turn allowed them the opportunity to engage in activities-such as sex with someone who was married , or of the same gender , or both-that otherwise would have been condemned .