It does look dodgy. Generally you can't discriminate against someone on the basis of a protected characteristic (race, sex, gender reassignment, religion etc). However, there are exemptions, so you can specify that someone is a particular race, sex, religion and so on if you are redressing an existing imbalance or there is a particular need (eg female sonographer to perform mammograms). Later on in the ad it says it welcomes applications from Black people to redress an imbalance, which is fine.
Identifies as female, though? That seems illegal to me. And bizarre too. No explanation is given for it.