Sharing an apartment is a common practice all around the world. For example, for this question, I will use the example of communal apartments that were built and used in Soviet Union as the solution towards a lack of housing in urban areas.
There are many advantages, and disadvantages to this type of leaving just like you mentioned. It's important to know that every apartment is different, and different types of apartments have different pros and cons to them. For example, sharing a simple one family oriented apartment between two families will result in an extreme lack of space; however, since we are using specially oriented communal apartments as an example, we are skipping this one.
Lack of personal space is one of the disadvantages, and most shared apartments have different bathrooms to solve this problem. One of few other problems included is the fact that one family is dependent on another. For example, if somebody's baby wakes up in the middle of the night and starts screaming, there is a great chance other family will wake up from the noise; however, most shared apartments are structured specifically to eliminate most of the noise.
Some of the advantages might be a much lower rental cost, greater ties with people you are sharing an apartment with, and simple mutual aid that can be given. I bet it's very fun for children to have a best friend right next their door!