I can possibly understand restricting a hermaphrodite to non-combat positions.
But other than that, why would it be anyone's business? Yes, they probably have some like that stuff on the books.
When I was taking a medical examination for application to the Naval Academy they discovered a "problem" which required further testing and investigation. Imagine all the ways a naval academy candidate has to measure up to get an appointment and yet could be passed over because they couldnt pee straight.
I think a lot of the time, people overestimate how much the military needs people.
Keeping the freaks out has actual benefits, especially when they just don't need you that badly.
I suspect your latter explanation is the correct one.
Keeping the "freaks" out may be simply to avoid the muddying of a simple M or F designation.
That, like severe uncorrected vision problems or impaired hearing, might not be obviously disqualifying to an outsider but in the combat environment it can quickly become a liability both to the individuals and others depending on him/her.
However, I strongly suspect "keep the freaks out" is a factor in many cases.
The obvious answer is no, and it's hard to expand any more within the bounds of GQ. You know, someone could have repair surgery done and never be told about it if it happened before they could form memories.