You can't restrict access to public toilets and changing rooms in quite the same way as hospitals, prisons, sport etc.
What politicians, the law and society can do is make it so it's perfectly acceptable for a woman or girl to report a man in a female space if that's an option at the time. That could be to workplace management, a store assistant, a security guard, gym reception etc. or even the police if necessary.
It then needs to be acceptable to ask him to leave and use either the male space or third space if there is one. If there is no third space that's not our problem to sort out.
Instead a climate has been created where women and girls fear objecting and if they do are treated as if they are the ones committing an offence. The group of NHS nurses taking action against their Trust is a perfect example of this.