Yeah... That's debatable, not absolute fact
And yes, you can own a house and invest. But the same applies to renting so that point is moot. The question is what is better strictly from a financial pov.
When people look at the rent vs buy debate, they only look at the monthly rental payment vs the monthly mortgage payment. The latter might be less, but what is not considered, and baked into the former, is:
1. Higher utility costs. Sewer, water, trash, usually isn't paid for by the renter. Unless the renter is renting a big ass house, the home owner will usually pay more for electric and heat. HOA fees. Landscaping. Clearing snow.
2. Maintenance. It's not a monthly bill but average out the cost of that new heater, roof, pipes bursting, the kids wrecking havoc... Conservative estimates of maintenance costs place it at 1-1.5% of home value per year. Renting eliminates that, and before you say that gets baked into rent, try passing $10,000 worth of repairs onto your tenant over 1 year
3. Opportunity cost of down payment and closing costs. That 20% you put down to buy a house is condemned to appreciate at an average rate of 4.1% (based on real estate prices over the past 30 years). That 6% in closing costs? Gone. You'll never see it again. Same thing when you sell. Imagine you take that 26% and throw it into index funds that track the market at historical rates of 9.5%. That's a lot after 30 years.
"Oh, I'll just put less down then." But then you pay more interest over the life of the loan, plus PMI which is a gift to the bank.
Now there are two advantages home owners have:
1. Mortgage interest is tax deductible.
2. Over the course of a mortgage, the payment to the bank (principal + interest) stays constant. Taxes and home insurance may go up but later in life the bank payment will become less than what you would pay to rent.
But here's the key point: it is very likely that for the first years, the cost of renting will be less than the cost of owning a home. And compound interest of an index fund where the difference is invested, will grow to a huge amount in 20-30 years. Investing the savings from home ownership later near the end of the mortgage, won't have as much time to compound.
It takes a spreadsheet to really do this breakdown justice, but if anyone is interested, google "rent vs buy opportunity cost".
Finally, I'm not saying that one should never buy a house. And if you want a house for sentimental reasons, go for it, whatever makes you happy. But from a purely financial decision,
anyone who says it's better to buy than rent absolutely without crunching the numbers is a damned fool and math illiterate. Depending on the location, budget, and other factors, the smart decision may be to buy. Sometimes it may be to rent. The bolded is all I'm pushing against.