While safety is a vitally important issue, and, unlike what was claimed in the US article cited by Baileyonice, there have been attacks perpetrated by transwomen in women's toilets, there are reasons other that 'safetyism' for men and women to have separate spaces.
Without going back to the history of sanitation and public toilets and all that,
there are very practical reasons why the established norm has been sex-segregated toilets, up to very recently.
Men and women have different ways of using toilets, due to the physiological difference between male and female bodies.
I have facetiously suggested that forcing men to use gender neutral toilets with floor-mounted toilets is discriminatory, because clearly urinals are more appropriately adapted for their use.
The throughput in men's toilets is much faster - I'm sure KTS knows the exact stats, but I think I'm safe in saying that on average women take twice as long as men to pee, and you don't see the long queues in the men's.
Having completely mixed sex cubicles slows everything down, and both men and women would have to queue for longer. Hardly a win for either sex.
When you do away with single-sex cubicle toilets, you have to replace them with individual 'universal' toilets which are building regs etc. compliant.
They have to be a contained space which includes not just the toilet, but also handwashing/drying, bins etc.
So not only is the toilet occupied while the user is performing bodily functions, it is also occupied while they wash their hands, brush their hair, etc., whereas single sex cubicle toilets are quickly freed up for the next user because handwashing facilities can be shared.
Again I defer to KTS who may be aware of research into the ratio of 'universal' toilets needed to provide the same level of access to toilets as single-sex toilets.
But I wouldn't be surprised if the removal of sex-segregated toilets and their complete replacement with 'gender neutral' toilets causes a net loss of provision, for both men and women, who are now forced to wait longer for the single-occupancy toilet to become available.
It's not all to do with 'safetyism', or Victorian notions of 'the weaker sex'.
The established configuration men's/women's/accessible worked, from a practical point of view, and the segregated spaces were generally speaking respected, until a very small, very aggressive group of men started asserting an alleged 'right' to use the women's toilet.
If it works, don't fix it. Men's/Women's [segregated on the basis of biological sex not gender ID] and accessible for disabled people who need them works.
Call me 'keeptoiletssimple', Keeptoiletssafe's tribute band😁