I've been telling friends and young people who have an interest in a house that buying land and living in a trailer or getting a fixer upper and doing work yourself is a much better option right now in most places.
Investing in a home is a contentious point amongst financial advisors. Too much home for certain is a problem for people - house poor or worse, insolvent. They generally recommend a benchmark of about 25% for housing ratio 1. That means you really should be spending no more than a quarter of your income on housing payments. They also recommend no more than 36% debt to income ratio (so add in car payments, student loan, etc.) and divide by income.
Some financial advisors say you are better off renting and investing your potential downpayment in the stock market. I disagree.
Many people who rent never reap the benefit of a paid off home in retirement. So they continue to pay rent which has been increasing at 6% per year the last 3 years. To beat that in the market, you need to yield a return of about 10% right now because inflation is stealing 3.5% and income gains have lost against inflation over that timeframe as well.
Another factor is that while you are building equity, your home value is rising. It has risen 35% on average the last 4 years. The 25-year average for home value inflation is a little over 4% per year which beats the 25-year inflation average. So your home is an investment asset IMO even if it is not seen that way if for personal use by many financial professionals.
Further, if you have a fixed mortgage, the payments are fixed (taxes, insurance, utilities, etc. aren't but interest and principal are). Rent isn't. If you stay in a home for 10 years, your housing costs are significantly less than rent. True, renters don't pay for repairs and recurring upkeep. But they pay more in rent than if they had bought the home themselves. I know, I buy homes and rent them. I make sure that I have a reasonable positive cash flow every month over all of my costs (including projected and risk factor for potential vacancy or damages). So, you will play less long term in housing costs if you buy.
Now where homebuyers get in trouble is if they 1) buy more house than they can afford 2) buy a house that has major issues like structural 3) use the equity in their home like a piggy bank taking out home equity loans and never getting much closer to being paid off 4) do not keep up their homes. There are others but that's a good start.
I keep very detailed records on my investments. I can tell you that the homes that I've bought with the exception of one in NY (taxes and all other cost increases were criminal) definitely have outpaced my stock market investments. My stock market investments have been pretty good long term, but the real estate, particularly the rental properties have been better. And I have multiplied my investment capacity by having renters fueling additional income streams and building my equity in several properties (plus it is shows well at tax time being able to use depreciation on those properties). I've averaged building wealth (net worth increase) at just under 10% per year for a long time and owning several homes is a significant contributor to that.