Yes, the law is unenforceable in many settings in the practical sense.
However, the law does put a societal expectation and defines the norms of behaviour. So even though, for example, shoplifting is also not being enforced due to lack of police resources, 99.9% of people still refrain from shoplifting because of the mere existence of the law against it.
If shoplifting were not against the law, the rate of offending would be much much higher than it is in the illegal but not really enforced gray area it exists in.
It’s the same with the single sex stuff. Given the ability of plastic surgeons and hormone treatments to transform appearance, those that pass will use the toilets for their gender, and those that do not will not. Women will feel comfortable as they won’t know the difference, as it’s all women and those who can pass for women. If there’s no law, then women will accost even masculine women because the lack of a law generates fear and insecurity.