Kristin Beck, a former member of the elite SEAL Team 6 who earned a Purple Heart and a Bronze Star for valor during 20 years of service insists that transgender personnel in uniform now pose neither a distraction nor a money problem. She's a transgender woman. She's stated that it's a matter of leadership. There are people who hate Christians, Muslims, Jews, blacks, gays, liberals, conservatives, Northerners, Southerners, immigrants, feminists, right-wingers; there's a torrent of hatred, and there has been throughout human history. As a leader she was able to "take a Muslim and a Bible-thumping Christian and have them work together with no problems. They would serve with honor together and do a great job."
My grandparents thoroughly agree with her. They grew up when schools and public facilities were segregated by race, and a black person daring to drink from the water fountain labeled as being for whites only, or to use a bathroom other than the ones clearly designated for "colored" people were frequently subjected to harassment and abuse. They knew young men who were worried going into boot camp about sharing a bathroom with "colored boys". And they saw how prejudices faded when uniforms were put on, when missions were worked on collectively, and soldiers saved one another's lives regardless of their race. And when soldiers returned home, the prejudices they once held were often not brought back with them. In some families that changed the lens through which children grew up viewing people of other races. Racial integration in the military and the workforce helped to push along the evolution of societal attitudes.
The hatred for transgender people you reference is all the more reason for them to be in the military.