Interesting thought experiment. This seems repugnant at face value. Would it be equally repugnant to have a scholarship restricted to Computer Science majors? How about a scholarship restricted to high academic achievers? What types of "discrimination" are OK? Where is the line drawn?
It's drawn at things you can change about you. You can become a Computer Science major, and you can study hard and become a high academic achiever. But you can't become a woman if you're not. EDIT: I assume it's clear that the above means "It's drawn at things you can change about you without resorting to surgery" and "you can't become a woman if you're not, without surgery"
IANAL, etc.