I don't expect Mr Trump actually put a lot of thought into this. He tends to make rash decisions.  I expect the recommendation came from the joint chiefs.

That being said while I agree the armed forces should not discriminate there are a lot of logistics and security issues that need to be addressed. While western civilizations are more tolerant I would hate to think how an American transgender POW would be treated by a less enlightened captor (e.g. taliban, ISIS, etc).

It took quite a while to accommodate women. Give it time.

It always begs the question though. If transgenders are not allowed in the military would that be an excuse from the draft should the Americans ever need to reinstitute it?