selffellatingouroborosofhate has covered a lot of excellent points. I also have a distinct sense of deja vu here posting this as I am sure I posted something like this answer in reply for glovedhandcec previously. I suspect that it was summarily dismissed.
However, if of course is not just sexual assault that is an issue. Female people need safeguarding because the risk with any physical attack is greater. Greater risk of it happening, but also greater risk of injury and serious injury including life changing and life limiting injury.
This is because (and we even have studies proving this now) male people generally have a physical advantage over female people. So much so that the weakest 25% of male people are still stronger than 90% of female people. Even those male people who choose to suppress their testosterone (or electively remove the source of their testosterone) are still not as weak as the weakest woman. Because is also is not just about muscle mass, skeletal leverage and bone mass, connective tissue and other aspects all play a part. (Happy to link the studies as evidence we have them easy to find).
The point is that safeguarding is not about completing eliminating risk, it is about minimising it while allowing people to go about their lives. Hence there are no toilet monitoring in person or using id cards as some people who try to use extreme arguments mention. Instead societies such as the UK use laws and policy and public knowledge so that people know where they should and shouldn’t be going. And it should work that if a male person knowingly enters a female single sex provision they will be legally be able to be removed. Hopefully before any harm can be done.
There are weak arguments presented to refute these safeguarding principles such as: but what about female on female violence? Yes. It happens . However, so that people can use publicly accessible facilities the by laws and national laws have to be usable and reasonable. It is reasonable to expect that the average female on female attack will not produce the same injury level as a male on female attack.
Due to grip strength of male people, (again, happy to provide studies showing grip strength differences, even male children have greater grip strength before puberty) it is also less likely that a female person has a chance to escape when a male person holds onto them vs a female person.
Can female on female attack happen ? Yes. It is probably less likely though if you look at conviction rates as a gauge for propensity for violence.
Is there a reasonable expectation it will be less likely to cause serious injury and more likely the victim can escape? Yes. So that is why sex segregated spaces exist and how public provisioning can be meet the expectations of usage flow.
It was never just about privacy and dignity even though those are really important too.