Do you think that a group with a protected characteristic (say Christian, Muslim, gay people or people with disabilities) should be able to exclude another group (say Christian, Muslim, gay people or people with disabilities)?
I am not a legal expert, but the answer to your question has to be yes in some instances.
The Archbishop of Canterbury has to be a practising member of the Church of England with years of experience as an Anglican clergyman. At the moment he also has to be male. It's exceedingly unlikely that a gay man, even if celibate, would get this job.
A person who is registered blind is not going to be able to get a job as a commercial pilot.
The reason for excluding transwomen from the women's pond is not because of the protected characteristic of being trans, it's because they are male. There are lots of cases where it's proportionate and sensible for safeguarding reasons to exclude males, no matter what their gender identity.