You have probably heard it a million times: Buying housing is better than renting because renters forgo the opportunity to accumulate equity in real estate. There was even a time when people thought that it was worth promoting homeownership because it reduced crime, although more recent research has found that areas with high rates of homeownership have less flexible labor markets and lower rates of entrepreneurship. Yet the biggest problem with the conventional wisdom is that home equity just isn’t a great place to put your money -- especially if the tax code ever gets fixed. This doesn’t mean that buying is inherently inferior to renting, but it does mean that many prospective buyers might be better off renting and accumulating wealth in other ways.

I’m reminded of all this because Robert Shiller just won the Nobel prize in economics for his research into the psychological drivers of asset prices. During a recent interview with Bloomberg TV, he said that spending on shelter is consumption, not investment. This is because the equity that homeowners exert such effort to build barely keeps pace with inflation over long periods of time. Shiller has shown this for U.S. home values since 1890, while other scholars have noted similar patterns in Beijing and Amsterdam over even longer time horizons. In other words, homeowners are paying interest for the privilege of owning an asset that returns less than Treasury bills.

Unlike Treasury bills, which tend to pay more than inflation over time -- and much less than stocks or longer-term bonds -- an individual house is difficult to buy and sell on short notice. Every transaction involves paying fees to banks, lawyers and real-estate agents. There are also maintenance costs and property taxes. The price of a single house also can be quite volatile.

This doesn’t mean that it’s always a bad idea to buy a home. Owning is the best way to lock in living costs if you plan to stay in the same place for a long time. After all, rents can go up, landlords can change and moving is a hassle and can be costly, too. So while the flexibility of renting is valuable to younger people who are frequently changing jobs and moving to new cities, buying makes more sense for people with stable occupations. (There are also qualitative differences in the types of housing available to renters and buyers that may make buying more attractive to certain people, although this is partly a function of where you live.)

The biggest cause of the housing bubbles of the last decade was excessive credit expansion, but the common fallacy that houses are a good way to accumulate wealth also was to blame. Maybe Shiller’s prize will remind us of that.

(Matthew C. Klein is a writer for Bloomberg View. Follow him on Twitter.)