Somehow this became a cultural thing in the US. In some other countries like in South America it’s perfectly normal for 3-4 generations to live under 1 roof.
My guess is it’s tied to making people spend more money for capitalism. The effect it’s had on families is not very positive. It leads to things like elderly people draining thousands from their savings or family members a month for nursing homes. People have to hire child care when otherwise family members could watch a child. Children grow up with more distance from older relatives. Buying additional homes and cars is way more expensive than sharing them. Additional cable and utility bills. More appliances. More food waste.