And beside serious investors, for the typical individual, a home loan allows them to leverage funds that are unimaginably beyond what they could raise for investment with vastly more safety. Not that I suggest it would be better if half the population could and did buy stocks on unlimited margin or the like.
I just want to point out that even on this one particular issue, we gradually made policy and decided and made it such that one kind of loan is vital and the other insanely too risky. That at this point, this is so ingrained that it's hard to imagine any alternative. But I suggest we should probably try.
[1]: https://investor.vanguard.com/mutual-funds/profile/performan...
[2]: https://investor.vanguard.com/etf/profile/performance/vnq
This is a very important point. Buying real estate is the most accessible way for an average-income household to get leverage - at least in the US where heavily leveraged financial products like CFDs are not easily accessible (at least to my knowledge). But in my opinion this another argument against investing into real estate because lots of uninformed buyers are in the market with increasing amounts of leverage leading to rather dramatic boom and bust cycles (like in the housing crisis of 2008).
Saying land/housing prices are outpacing many other productive investments seems like a stretch. If you look at the performance of large US REIT ETFs versus market indices like the SPY the rent seeking behavior by real estate investors doesn't look so profitable.