There are alternatives like pensions, improving social security and medicare/medicaid, etc. The de-prioritization and gutting of these has probably contributed to housing taking their place.
But housing isn't a sustainable answer. It's basically done. Current generations can never see the kind of housing appreciation their parents did. Prices simply can't go up much more except in areas that are undervalued and never saw a run-up in previous decades. New buyers today risk the opposite: straining to buy into overvalued markets only to see them crash and leave them underwater. Housing as a source of retirement funding is a one-generation-and-done phenomenon.
Personally I would not touch real estate in overvalued metros today unless I were rich and could afford to lose 25-50% of the value of the home. If interest rates don't come back down to near-zero and/or if the trend toward telework and geographic decentralization continues, these areas could very well crash.
The "hard asset" value of a house is a very small component of its total value. The majority of the value directly relies on the government policy of overwhelming monetary inflation dumped into the financial industry. That policy can be changed much easier than bona fide entitlement policies, and perhaps it has even started changing already.
If so, only at the expense of the next generation who will find it even harder to afford a place to live. When housing prices go up it means the next generation will find it that much harder to afford a place to live.
The fact is, for many people having a home that they build equity in is the closest they’ll ever get to some kind of “savings” account. When the home is paid off in 30 years they no longer need money saved up to buy a retirement home because they will have full equity of their house which may have gone up substantially in value. They could then sell this property and downsize and continue to live off the proceeds from the equity they sold.
If homes weren’t investments, it means people would have to be a lot more serious about saving and investing money for the future, and frankly that just isn’t going to happen at scale given human behavior.