Ive been thinking recently about what the best way to compare opportunity cost of home ownership, so Im glad to see others thoughts.
Inflation seems to be constant across owning outright or renting (although not so for mortgages), so the question seems to be what the expected appreciation of the housing market (on top of inflation) is relative to other investments like stocks, and what the variance of the two are. If the housing market appreciates faster than the stock market, then owning will be a good investment (assuming that the taxes, repairs and utilities of ownership are less than rent and utilities), and not owning will likely mean rent increases roughly corresponding to the housing increases.
If the housing market grows slower than the stock market, then owning can still be profitable, but not necessarily so. For example, in our area in eastern Massachusetts, the cheapest house within 10 miles of our work is $250,000, with property taxes around $4,500 a year and combined utilities gas, electricity, water, garbage of $4,000 +/- $2,000 a year (not including repairs, with a lot of the cost and variance here coming from heating in the winter). We currently pay (a sub-market rate of) $950 / month including utilities for an apartment 3 miles from work, which means that even if the real estate market and stock market were comparable, we still would not necessarily save money by owning.
There are other factors we rent a private apartment inside of a house, and while buying would give us more space, the corollary is that its not easy to buy a small single dwelling (and the few that exist arent discounted based on their size, and often have HOA fees).
Another cost of ownership is the opportunity cost of being able to easily change jobs. The transaction costs of buying and selling mean that, unless were interested in becoming landlords, buying may not be financially lucrative, either due to closing costs or income lost by not accepting other job offers.