In fact, sports may be a guide to many situations.
Most sports are segregated by sex for reasons of safety and fairness.
But safety and fairness for females, not males. Males are not adversely affected by allowing females to compete against them in most sport.
So, it's legitimate to have a protected female category, for biological females, and an open category for all, subject to doping rules.
The same could be true in many other circumstances: a protected female space alongside a unisex space.
But far better would be to drop the "female" category in favour of sporting divisions based on relevant and measurable attributes. Height, weight, reach, muscle-fat ratio, or lung peak flow would make a better basis for classification in sport than gender.
Having women's and men's teams is a tradition, not a law of nature.
Most men cannot compete in elite men's sports. That no women can either is not a justification for a separate 'women only' competition, it's a justification for a "less than elite" competition, or better still a whole hierarchy of them. And in most sports, such hierarchies already exist.