Not only the Village People but there is a gay subtext to the Y that goes back over a century apparently. All I remember growing up was that we went to the YWCA for free swims. It was associated with athletics/fitness.
When I was a kid back in the 50’s, the YMCA in our town “required” all men and boys in the pool to be totally nude. I also remember being sent there with the Cub Scouts for “free” swimming lessons. Old men were seen hanging out (no pun intended) on the balcony above the pool on the one side leering down at our naked little asses. The instructors, also nude,would put their hands under your stomach to support you and teach you how to move your arms and kick your legs. I don’t care what anyone thinks about it, this place at least in my town in Western Pennsylvania was a mecca for pedos and queers. A Google search will show that this was common at the YMCA in a lot of places at the time. The funny thing about it was that nobody’s parents ever complained. Most of the kid’s dad’s had also gone there when they were kids and saw nothing wrong with it.