It's gonna get buried, but petesergeant had a good comment sharing this article.

They are also banning females from female sports as well with this ruling.

https://www.olympics.com/en/news/semenya-niyonsaba-wambui-wh...

Caster Semenya is XY with a DSD (5-ARD), and absolutely should not compete with females. The same goes for Imane Khelif who was the same DSD.

People with this condition have internal testes, a male level of testosterone, and a male level of muscle development. That a doctor assigned them female at birth and put a F on the birth certificate does not change this.

The upshot of this is that women with a genetic advantage are banned, but men with a genetic advantage aren't; is this not straightforwardly sex discrimination?

No. Nobody is banned from the "men's" category, including unambiguously cisgender women of completely unambiguous sexual characteristics. They just wouldn't stand a chance, practically speaking (for example, in the 100 metre sprint, the all-time women's world record time would not meet the qualification standard). There was already "sex discrimination" in the fact of the women's category existing in the first place; this was done as a pragmatic matter so that the world has the opportunity to celebrate peak female physical achievements.

The debate is really around how the handling of intersex and transgender athletes intersects with the original purpose of creating a separate category for women.

Intersex category would be perfect fit but this is very rare condition so there wouldn't be enough competition.