I went into a house with a bathroom in a living room. That was so weird
I assume you mean the bathroom was a separate room off of the living room and not that the toilet was actually in the living room, which would be a lot more weird.
Houses of a certain size and price point tend to assume that the owners of the house will regularly have guests over, and thus will include a bathroom specifically intended for guests. This is done both for ease of access, and to discourage guests from wandering into the parts of the house containing more private areas, such as bedrooms. I have seen houses set up to have the bathroom in the main entryway, for example.
Smaller houses tend to locate bathrooms in a more utilitarian location. For example, my house has one of its two bathrooms off of the main hallway, in between the second and third bedroom. (The other bathroom is located off the master bedroom and thus is not accessible to guests.)
My parents' 2 bed/3 bath house has only one toilet not accessed through a bedroom, and that is located in the laundry room, which is an odd choice, since most people wouldn't want their guests to see their washer and dryer or any laundry left in there. More oddly, the room contains no sink—there is one in the hallway, however (which also leads to the garage, meaning someone coming in from outside can easily wash their hands, if necessary, before entering the main body of the house).