"I see a court challenge coming"
I am curious as to what law you feel this would violate..

Certainly not the constitution, as there is no inherit right to serve in the military.
The civil rights laws itemize discrimination based upon race, color, creed or gender.

If you were to challenge this, what grounds would you employ?