I feel the same way about pregnancy. It's elective. A knocked up soldier is of no benefit to the military. But, it certainly happens and more so than any reassignment surgery but yet nobody is calling for a ban on women.
It's the inconsistency of the justification that bugs me. Either do the ban across the board or not at all.
I do not think that pregnancy is considered "elective". Often, when a sailor became pregnant, they were removed from their ship, and often from the Navy.
Realignment surgery is hella expensive, and purely elective. There is no driving medical need for it, like delivering a child.
I do not believe the military pays for nose jobs, or face lifts, or other similar cosmetic elective surgery, and those things are far less expensive. Heck, everyone wins if sailors get boob jobs, right? But, I don't think they're paid for either.
If John wants to dress up as Jane, talk like Jane, have people call him Jane colloquially, etc., I see no problem. So long as John fights as John, meets the physical requirements of John (including dress in uniform), etc., I still see no problem.