Housing was never an investment before recent decades, with an emphasis on the housing bubble. Housing tracked inflation for 400 years.
https://thegoldobserver.substack.com/p/amsterdam-real-housin...
edit: the history of US house prices is that they strictly tracked inflation, then with government subsidy right after WWII, housing prices jumped up, then stayed flat at that new level for the next 50 years, then the turn of the millennium happens and housing becomes an investment (after a stock market crash.)