Probably because of so many heterosexual GenXer, Millennial, and Zoomer servicemen in the current U.S. armed forces have many gay friends, so they know that a gay soldier isn't "automatically" someone who is likely to violate their personal space. The servicemen from older generations were probably making hasty assumptions about any gay men within their ranks.
Gang/communal showers are easier for custodial staff to clean and maintain...which is probably why the military still uses them so frequently -- and it's why they still serve a purpose in schools and adult gyms, even when giving boys/men the option of some private stalls because they need/want them for various reasons.