I am definitely in the camp that homeownership is a lousy investment
People conflate and confuse the issue by talking about it as an investment.
But you need somewhere to live.
Let's compare the two scenarios I mentioned before (owning @ 400 mortgage vs renting at 1000).
Say you put down 25k in down payment/fix up costs, and the mortgage is 400/mo (and we'll say maintenance, etc. at $200/mo = 600/mo total ownership costs).
Versus renting at 1k/mo.
That 25k down payment could instead be invested, and at a 4% SWR it would give you 1000/mo (or one month free rent). So you'd spend 11,000 on rent for the year.
Versus owning, having that 25k in equity gives you no returns, so you spend 7200 on owning the house.
Wow, you saved 3800 by owning. (Plus all the other unmentioned things like mortgage interest deduction, potential appreciation, equity/principal paydown, etc.)
Don't think of the house as an investment. Why the hell would you compare apples to oranges, or house ownership to stock ownership? It's not an investment, you're right.
But what you should compare is owning to renting. Because you need to do one of those, because you need a place to live. Compare those, and choose the best.
People who rent because "owning is a bad investment" are fooling themselves. How good of an investment it is is completely irrelevant.