Ensign David Leavitt and friend
The Second World War was a huge disruption of American life. People from farms, small towns, and cities, from all regions and classes now found themselves suddenly uprooted and thrown together. People who had never traveled more than 5 miles from home now found themselves in the South Pacific or flying over Central Europe. This was true, not just for soldiers, but for civilians on the home front. The war created desperate labor shortages in factories contracted for war production. Those jobs were filled by women, African Americans, and other minorities. Like the soldiers, many of these workers left home and found themselves living together, sometimes in close quarters in alien environments. Time honored customs and beliefs about class, gender, region, and race came under unprecedented strain. While this created incredible stress for many, for others, this created unexpected opportunities and raised expectations.
Gays and lesbians were an invisible minority; not only invisible to society at large, but to each other. Most of the American population at the start of the war still lived in small towns and on farms. A lot of gay men and lesbians from those backgrounds who previously felt very isolated now found each other in the military or in wartime production. Within the ranks of the military, a huge underground gay culture began to flourish. Gay soldiers in the South Pacific would create "gay beaches" for gathering sometimes within days of capturing an island from the Japanese.
A gay soldier from rural America recalled visiting Paris within days of liberation in 1944. He sought out a once famous Parisian gay night spot thinking it may still be closed for the duration. When he arrived, the place was wide open and packed with soldiers from a dozen different countries. He described American and Free French soldiers dancing together with Polish and Italian partisans and British troops. Not only did this soldier no longer feel isolated, he also began to see a certain potential. Gay men may have been a minority, but they were not a small minority. Formerly isolated gay men and lesbians discovered that there were lots and lots and lots of people like them. This caused a lot of people to rethink some things and to get some ideas.
Even when the military's policies toward gays and lesbians became increasingly aggressive and more punitive as the war drew to a close, this emerging gay culture continued to flourish, and it survived the war's end. Large American port cities like New York, Boston, Chicago, and San Francisco found themselves with huge populations of gays and lesbians at the end of the war; people who couldn't or wouldn't go home again. Friendships and communities formed during the war would quickly become useful for resisting and pushing back as an increasingly paranoid Post War America tried hard to put the genie of expectations for women, African Americans, and LGBTs back into the bottle.
I strongly recommend Alan Berube's book mentioned in the previous post, and John Loughery's The Other Side of Silence, Men's Lives and Gay Identities: A Twentieth Century History. Loughery's book fills in some more details about the experiences of gay men in World War II, and tells a splendid account of their experiences after the war and into the 1950s.