Let us untangle the words sex and gender, which have become so confused and adulterated. In the past they were almost synonymous but today are quite different. The Online Etymology Dictionary notes:
As sex (n.) took on erotic qualities in 20c., gender came to be the usual English word for “sex of a human being,” in which use it was at first regarded as colloquial or humorous.
Academic theorists have successfully tied gender to culture, which can change with one’s place, time, or personal inclinations. Today there is no reason to use gender as a substitute for sex, for example on forms. Also one should not say sex when one means gender.
Let us then accept the simple distinction between sex, a biological term, and gender, a cultural term. In accord with this, let us distinguish male and female sexes from masculine and feminine genders. The former is fixed at conception, recorded at birth, and an aspect of physical embodiment throughout life.
Let us also acknowledge that there is no simple relation between male and female on the one hand, and masculine and feminine on the other hand. We could posit as a definition that masculine means the cultural expectations for males, and feminine means the cultural expectations for females.
But it would be simplistic to speak as though males are always masculine and females are always feminine. We are all a mix of masculine and feminine aspects, although their definition suggests that most males are mostly masculine and most females are mostly feminine.
What if a male is mostly feminine or a female is mostly masculine? Some societies would not permit it, but most find a way of accommodation. This has been the source of humor as, for example, the not-so masculine husband with the not-so feminine wife who appear to act in socially expected ways but really do not.
What if a male is so feminine they want to be addressed with a feminine pronoun, or a female is so masculine they want to be addressed with a masculine pronoun? On the face of it, masculine behavior and masculine pronouns might seem to go together, as might feminine behavior and feminine pronouns. But that would make society captive to personal behaviors that have changed and may change again. One purpose of culture, that is, social conventions, is to make things simpler for society. Conforming society to the changed and changing behaviors of individuals would make society the pawn of individuals. That would be counter to social solidarity.
So let us use pronouns that correspond to sex, not gender. A similar argument holds for what should be obvious, public accommodations such as public bathrooms that are related to biological functioning, in which public safety and comfort are also at issue.