Yes of course they can.
This is about the timing of the change in the rules for female military so they can wear makeup and nail varnish. For reasons of diversity. A week after the rules about trans military were changed.
Now personally I think as I'm sure most of us do that being trans, gay, GNC etc should be no bar to serving in the armed forces if that's what you want to do.
However with the huge problems with
Sexism sexual assault and rape of female personnel (in the UK been covered up I'm sure in the USA as well)
And the dangers that female personnel are exposed to by having uniform that is not cut for the female frame
It feels to me that there are more pressing matters than makeup and nail varnish.
Locs a different matter and presumably (?) for both sexes. So let's put that to one side.
Who remembers the first woman in the UK to serve on the frontline in an infantry role?
www.google.com/amp/s/m.huffingtonpost.co.uk/amp/entry/transgender-soldier-chloe-allen-is-first-woman-on-british-army-frontline_uk_57dd5ae6e4b028e52a10d40d/
History made. Women were barred from this role. They opened it up to women at around the time of this but the time taken to qualify meant that any other women applying would take some time to get in. Chloe was already in and so takes the first woman to do it place in history.
I would be really happy for Chloe to be the first open trans person in the role. That would be great.
But first woman? When no other women (unless in the same position to Chloe) had any way of getting there first?
A lot of pics of Chloe seem to have gone. At the time and in this article. Their trans woman status was indicated by slightly long hair, earrings and makeup.
In military garb and unadorned sex is harder to hide. The signals are around hair, makeup, clothes, posture etc. In the army the clothes and posture are prescribed. It's harder to signal feminine/masculine.
So yes I think that's why the rules were changed. To support trans women in the us military.