The Young Men's Christian Association or YMCA was founded in London, England, on June 6, 1844, in response to unhealthy social conditions arising in the big cities at the end of the Industrial Revolution (roughly 1750 to 1850). Growth of the railroads and centralization of commerce and industry brought many rural young men who needed jobs into cities like London. They worked 10 to 12 hours a day, six days a week.
Far from home and family, these young men often lived at the workplace. They slept crowded into rooms over the company's shop, a location thought to be safer than London's tenements and streets. Outside the shop things were bad -- open sewers, pickpockets, thugs, beggars, drunks, lovers for hire and abandoned children running wild by the thousands.
In the modern era, YMCA hostels have been described as hotbeds of gay sexual activity - courtesy of the affordability and privacy they offer.