A new breed of companies offering shared accommodation for housemates are trying to tackle the question of how to deliver affordable housing to low-wage workers.

They are part of a small but growing real-estate business known as co-living, in which developers offer shared bathrooms and private bedrooms that can run to less than 100 square feet. To compensate for the cramped quarters, building owners often offer such perks as housekeeping service, organized ski trips, yoga studios and cooking classes.

But...