Actually, it is significantly more complex than what you post.  Medical experts are not in agreement over the issue of gender dysphoria and it has been considered a severe mental health condition.  It is not an "identity" issue and is only considered a valid medical condition in those very rare cases of "XXY" chromosomes.  The military has incredibly strict medical requirements for recruits, especially officers, or others who must meet Personnel Reliability Program (PRP) requirements.
Do you really want people with a severe mental health problem working with the most powerful weapons on the planet?