There will be more to say, but I responded to a similar question a while back in relation to New York in the last couple of decades of the 19th century. You might like to review that response while waiting for fresh answers to your query:
The big change that has taken place over the past hundred years or so that makes flat-sharing seem natural and normal for us today is the rise in the development of labour saving devices in the home, and concomitant steep decline in the numbers of wives and household servants whose full-time job it used to be to do this work.
If we look at the situation in, say, New York in the last decades of the 19th century, for instance (a time and place I've researched in this respect), it's pretty clear that people with full time office or factory work would have not been able to keep and clean home for themselves – doing the laundry, for one thing, typically demanded a full day's work by one or two people for even a modest home at a time when all such work was done by hand, and every item had to be prodded and stirred with wooden paddles for hours at a time, then passed through mangles to remove excess water, hung out to dry on lines, and pressed using irons that had to be constantly re-heated on a stovetop or in a fire. (Robert Caro's celebrated chapter "The Sad Irons", in the first volume of his biography of Lyndon Johnson, tells the story of what women's work was really like before the advent of electricity in a highly evocative fashion, making the point that it was even worse outside the cities, where women would typically add hauling gallons and gallons of water up wells on a daily basis to the remainder of these tasks.) Similarly, very few men in this period knew how to cook, or would have considered household cleaning to be a task they should get involved in.
The result was that, rather than getting together to share a flat – and the household chores – with a few like-minded friends, any man in the New York of this period who could not, or chose not to, live at home with a mother or wife who could be expected to take on this drudgery would find a room in a place run by a landlady who performed all these tasks, and would charge not just for a room, but for room and board.
Two options existed for unmarried male New Yorkers of the period: the better-off would take a room in a boarding house, and the rest would find a tenement family to take them in. ("Two–thirds of New York boards," the saying went, "and three–thirds takes in boarders.") The city boasted tens of thousands of small, family–run boarding houses. Establishments of this sort were generally run by working class women who needed extra income in order to supplement their husbands’ uncertain wages, and who welcomed the prospect of work that enabled them to stay at home with their families. Although often disappointingly threadbare and uncomfortable, boarding houses provided meals, did their guests’ laundry and offered a mending service. At least in the popular opinion of the day, they often offered a sort of dating service, too, and young, unmarried male guests could hope to enjoy more personal attention from their landlady's daughters, the operation of a guest house being regarded as a useful way of meeting likely husbands.
What tended not to happen, therefore, was groups of friends arranging to live together. If you were a young male New Yorker in this period, your friends would still be living at home, or would be putting themselves up in a bedsitting room in another boarding house or tenement, and you would meet them in public places, rather than inviting them "home".
Sources
Rachel Bernstein, Boarding-House Keepers and Brothel Keepers in New York City, 1880-1910 (PhD thesis, Rutgers University, 1984)
Edwin Burrows and Mike Wallace, Gotham: : A History of New York City to 1898 (New York, 1999)
Robert A. Caro, The Years of Lyndon Johnson: The Path to Power (New York, 1982)