
It turns out, there is a connection between the YMCA and gay culture. It's a fascinating tangled thread that goes, as far as I can figure out from credible research, something like this:
1. Post-Civil War, the United States was trying to find ways for the nation to pull together. There was also an influx of immigrants. WASP leaders saw a need to create a coherent national narrative AND to train new immigrants in the way of American, Christian life. This meant finding an attractive Christian message.
2. The attractive Christian message was an offshoot of muscular Christianity--the use of gyms and fitness and the outdoors to give people purpose, attract them to form communities. During the late nineteenth century, people were also becoming interested in National parks, different types of diets, outdoor scouting, and other keys to a well-rounded existence.

Muscular Christianity worked--at least for awhile--because male affection was not yet as fully stigmatized as it became (a stigma that is only beginning to fade now). That is, the pictures to the left do not automatically denote homosexual relationships.
Or they do.

3. The YMCA was safe for gay men. The gyms and baths were largely unmonitored due to lack of funds and mind-your-own-business nineteenth century attitudes--which extended to prostitution, at least for awhile. YMCAs didn't get raided (until the early 1900s). Bohemians tended to congregate elsewhere. But for men who wanted to experiment, men who thought they weren't gay, men who were closeted (and sometimes married), and men who were anxious about going to jail, the YMCA was a haven.
"Cruising" was a regular occurrence in the YMCA through the late 1800s into the early 1900s.

4. Scandals did break, of course. (Conspiracies, even unintentional conspiracies, and talkative human nature do not mix well.) The reaction was a growing stigma of male affection--platonic or not. What the YMCA started out by extolling became problematic behavior that embarrassed the institution publicly.
When a culture relies largely on self-monitoring, stigma is the default position. Other far more restrictive cultures may not have the same stigmas.
The stigma of male physical affection is beginning to fade. Leonard can say wryly about Sheldon, "Well, maybe we are a gay couple."