The reason he gave makes sense though
No it does not. HRT costs on average about $60/month or less, and that's assuming they have even decided to transition at all. That's less than the expense for someone with severe allergies who needs an epi-pen (which costs $600, each). Does it make sense to ban people from combat because they have bad allergies? How about people with HIV who need constant, expensive treatment but are otherwise perfectly functional?
The medical cost argument does not work here. Trans people cost a negligible amount, and a huge number of much more expensive conditions are apparently perfectly fine to have when you're in the military.
I won't even go into how dumb this is from a recruitment standpoint. There is no valid justification for this.