Why is a person who shares a house in the US called a roommate, not a housemate?
Solution 1:
When I was in college and graduate school, a roommate was definitely a person with whom one shared a room. Students rarely shared houses in those days, and when they did, they were called housemates. The word roommates is still used to mean persons sharing a room, as these selected quotes from the Oxford English Dictionary show:
1849 W. S. Mayo Kaloolah (1850) 107 My interesting room-mates were so far recovered as to be able to take the air upon deck.
1873 C. M. Yonge Pillars of House III. xxx. 170 The room and the room-mate that had seemed so disgusting to home-bred Felix.
1912 A. Brazil New Girl at St. Chad's i. 19 One of my room-mates snored atrociously.
2004 A. Robbins Pledged 16 On the fourth floor, the sophomores' floor, Vicki headed to the tiny room she would be sharing with three roommates.
I selected only the quotations where roommate unambiguously meant person sharing a room, although the snorer might be able to make himself heard throughout a house.
The first quotation the OED gives for roommate is from 1789. The OED defines roommate as:
orig. N. Amer. A person occupying the same room, flat, or house as another
In contrast, the OED definition for housemate and all its quotations mean a person sharing a house with another. For example:
2004 C. Kettlewell Electric Dreams 11 He..was looking forward to shorts and a T-shirt and maybe a cold beer at home, and laughing it over with his new housemate.
Of course, that quotation could be from a UK source. The first use of housemate in a quotation from the OED is 1593.
I'm afraid this hasn't got you very far forward with your question as to how roommate took over housemate in the US -- and to a certain extent in the UK, as shown by the OED definition of roommate.
My own speculation -- and it is just a speculation -- is that many people have roommates in college (i.e., share a room) and they just keep that word when they graduate, so to speak, to sharing a house.
Suite-mate is also used. OED:
suitemate n. chiefly U.S. a person with whom one shares a suite in a college or university residence hall (cf. roommate n.).......
..... 2003 Jrnl. Hist. Sexuality 12 207 His suitemates complained about living with someone who identified as bisexual.
Solution 2:
The shared use of living space seems correct to me. And, given that, I would say that the North American use of roommate certainly does mean sharing one or more rooms.
The Merriam-Webster definition of roommate is:
: one of two or more persons sharing the same room or living quarters.
However, it doesn't need to apply to every room and it certainly doesn't apply to the bedroom specifically.
Although I will note that some university dormitories (or at least as popularized on TV and in movies) do have a single room with two "sides"—each of which has a bed. Roommates in these living quarters share the room—even if they sleep in separate beds. Such single-room dwellings were more prevalent in the past too.
As for public spaces such as restaurants, people there aren't roommates because none of them live there.
But in E.L. Konigsburg's award-winning children's book From the Mixed-Up Files of Mrs. Basil E. Frankweiler, a brother and sister end up running away from home and "living" in a museum. They could arguably have been called roommates when they were there. Even though they didn't sleep in the same room.
As a kind of counter question, I would be interested in knowing how the British use of roommate ended up having the specific meaning of "bedroommate" when there are so many other rooms.
Update
Here are some additional notes:
In North America, it seems the closest equivalent of the UK's roommate (and what I somewhat jokingly referred to as "bedroommate") is bunkmate. Rather than using the generic word room (which can refer to any room rather than a specific room) the word bunk is used—which carries the particular meaning of "bed". (It's commonly used in relation to the military, but can also be used in such situations as camping or other accommodation. It means "sharing a bedroom," even though not in a romantic sense.)
In short, it seems that housemate and roommate (UK) can translate to roommate and bunkmate (US).
We have the expression share a room, which, as a phrase, does suggest a romantic involvement with someone. But it's something quite distinct from a discussion of the word room and how it came to be collocated with mate to form roommate. Saying "I'm going to get a room" means something quite different from "you two should get a room." And even when I say, "I'm going to get a room," it normally means a hotel room—which can include more than just a bedroom. In fact, for people who end up with a sudden windfall and who decide to "get a room" at a fancy hotel, what they generally mean is that they are going to get a suite.