If you're downrange in a fighting position bearing down against enemy forces, whether the person next to me is trans, gay, lesbian, bi or whatever is irrelevant so long as they're on my side and fit for duty. OTOH, if, in that same scenario, the person next to me starts having issues because they're coming to terms with their gender identity and wants to run off to talk to their therapist, well, I'm going to have reseverations about their effectiveness.
I can certainly see transgenderism in military personnel manifesting a mental instability that would put in question their reliability as soldiers. Certainly that instability came into play regarding the prosecuted offenses of Bradley Manning.
When I first heard Trump say his officers requested the ban, I believed it, with the Manning case in mind.