Indeed - this came up in a court today (Good Law Project & others v NHS England judicial review). It's an example of clear discrimination (on the grounds of sex) looked at one way; but of such discrimination not in fact existing looked at another way, if you for example argue that it's a function of relative prison population size and not of sex. And while the latter could still mean indirect even if not direct sex discrimination, there is of course the fact that some women will happen to end up housed closer to home than some men. And so on.
I don't know the exact court case they were talking about on this and so I don't know which way that one was ruled, re the sex discrimination. A question of relative spending per prison placement also came in the same case I believe.
But in terms informing a discussion of where male prisoners should be housed - it's interesting to hear that France has chosen to set up a specific prison for prisoners that identify as transgender, because that presumably means that such a solution is compliant with European HR requirements (which remain the basis of our own rights/discrimination laws).
But yes as someone has mentioned re the unsuccessful JR on prison policy here a year or so ago; the idea that women prisoners exist to provide an "affirmation" service to this subset of male prisoners seems to run very deep within England & Wales prison policy. (Scottish too I have no doubt but I know less about that).