To be honest, looking at the cost of transition in the US when I first joined this site I was shocked at how expensive it could be. I genuinely wonder where and how people raise the money to pay for it sometimes.
So if the military don't want to pay for that, I can sort of see their point. Would they normally recruit individuals with expensive medical conditions? I mean if they do, routinely, recruit people they have to pay the medical expenses of, then that's clear discrimination against trans people. But if they have a general policy of not accepting anyone on the basis of it, then I guess that's that. (Would the military accept a non-trans person enlisting who was scheduled to have say, several medium-risk surgeries in the future, for example? or someone on medication for life?)
I don't know about their policies though. I would consider being trans and going for surgeries and so on quite a burden on the trans person, and therefore possibly the military they are serving in. But if they are already transitioned and serving, I see far less of a reason to exclude a serving transperson.
In some ways I see potential problems with the costs and the recovery time for some trans people. For those without those issues, it's clearly quite unfair they should be dismissed like this. I can see why people are angry.
That said, I've considered working for companies before abroad and they had some very strict health regulations; they refused to take anyone with anything they considered costly in the medical department - mandatory chest x-rays and all to make sure you weren't carrying anything debilitating. I figure they just didn't want to be concerned with an employee's medical issues becoming their own. I don't necessarily agree with it or find it fair, but I understand it from their financial perspective.