Plus you need a place to live. Factor in rent costs to the investment side, and you're losing value for investing returns. Factor in a lot of nice tricks you get with real estate (tax break for interest, ability to flip up with no capital gains along the way, dozens more), and housing is a pretty good investment.
https://www.investopedia.com/investing/reasons-invest-real-e...
https://www.millionacres.com/real-estate-investing/articles/...
Find me a broker that will lend 5X the value of my stock portfolio at 3% fixed for 30 years, and won’t issue a margin call if the market drops 50% as long as I pay the interest and monthly repayment, and I promise I would never look at real estate at all. Until then, it makes complete sense to dabble with it.
I believe it's been shown that investing in equities outperforms housing historically.