It does not matter WHY an employer may want this, that is their prerogative.
It's not their prerogative, to limit a position to only women (or whites, black, straights, gays whatever), IS discrimination. It does not matter why they want this, they CANNOT do this.