Well, two questions really. The onus always seems to be on those arguing for single-sex spaces to demonstrate that exclusion is a proportionate means of achieving a legitimate aim. Why isn't the onus of proof ever on the claim that the protected characteristic of gender reassignment requires the inclusion (in particular situations) of people with that characteristic? I don't mean people with a GRC, I mean the wider group of people who fall under that characteristic?
This is standard equality law and applies in a wide range of situations, not just to single-sex spaces.
If A claims that B has discriminated against them, all they have to show is that B has disadvantaged them due to a protected characteristic. B then has three main defences - that their actions weren't discrimination at all, that they were discrimination but one of the exemptions in equality law applies, or that the discrimination was a proportionate means of achieving a legitimate aim. So, for example, if a hospital finds that a surgeon is losing their sight, they can stop them performing operations as patient safety is a legitimate aim. If a business that buys most of its supplies from India is making redundancies in its purchasing team, they might legitimately be able to prioritise team members who speak Hindi even if that discriminates against people who are not of Indian heritage.
The law is the way it is partly because it is difficult to prove a negative (i.e. for the claimant to prove that the respondent did not have a legitimate aim, or that the means were not proportionate, although claimants do argue that), and because the vast majority of cases are brought by employees against employers, or individuals against public bodies. Putting the burden of proof on the claimant would make it much harder for them to win cases. Reversing it for gender discrimination only would be problematic and would make it much easier for employers to discriminate against people on grounds of gender (if people think gender and sex are the same thing, that would be a serious setback for women's rights). There is already a complete exemption for small associations (i.e. those with fewer than 25 members).
It might be possible for parliament to give some kind of exemption to single sex spaces that wouldn't have unwanted side-effects but, in my view, that is much easier for the courts to achieve. Parliament can tie itself in knots trying to come up with wording that gives only the exemption they want to give and still find there are situations they haven't considered that fall the wrong side of whatever law they come up with. The courts, on the other hand, can apply the existing law based on the facts of each case and come up with binding precedents, which is the way the law normally works.
So here is my second question: Given that the protected characteristic is essentially defined in relation to a specified process (not to a state of being such as 'gender identity'), what are the 'legitimate aims' that might reasonably be considered to be associated with the protected characteristic?
That is up to the courts. In my view, it would be a legitimate aim to say that a rape victim should have the right to be examined only by someone who is biologically female, for example. I also believe it is a legitimate aim for a group for lesbians to want to restrict their membership to individuals who are biologically female. In my view, this also applies to groups catering for female rape victims - yes, there are male victims of rape, but I think there is justification for saying this should be a truly single sex space. However, these are my personal views. I don't know of any court decisions in this area.