I did some back of the envelope calculations comparing housing in my area vs market. Taking the long view, accounting for property taxes and mortgage interest payments, housing did not beat the market.
Did you account for the fact that equity gains in real estate for primary residences in the US are tax free? Your equities, even long-term, are taxed at a non-zero rate.
Just to clarify the capital gains you have on the sale of your primary residence isn't tax free. You get the first $250k free for an individual and more for a married couple. This is very generous and better than you get for equity investments for sure, but once your gain exceeds those amounts it is taxed at normal capital gains tax rates.
I did. Where I live you can rent cheaper than a mortgage payment (plus tax and insurance) by about $1000 per month, so owning has an additional $12,000 per year cost based on that alone.
Plus stocks are almost immediately liquid and have almost no transaction and no maintenance costs and no annual property tax.