This commonly held wisdom seems to be a holdover from the pre-2008 days, and I wonder how much longer it will last.
http://www.businessinsider.com/map-of-us-housing-market-grow...
Unless you're buying property in a coastal city, odds are good that your home value will, at best, stay the same year over year. If you buy a house in flyover country it might actually depreciate.
Add to that the costs of a mortgage, property taxes, repairs, buying/selling fees and home ownership seems like one of the worst possible investments to me.