The below assessment is for primary residences as opposed to income properties.
The truth is that with the exception of a housing bubble, the value of a house might outpace inflation by one or two percent. According to the US Census, the price of a new home per square foot only went up 4.42% between 1963 and 2008, where as inflation was 4.4%. Since home sizes increased, the price of a new home overall outpaced inflation by 1% at 5.4% (source). According to Case-Shiller, inflation adjusted prices increased a measly .4% from 1890-2004 (see graph here).
On the other hand your down payment money and the interest towards owning that home might be in a mutual fund earning you north of eight percent. If you don't put down enough of a down payment to avoid PMI, you'll be literally throwing away money to get yourself in a home that could also be making money.
Upgrades to your home that increase its value - unless you have crazy do-it-yourself skills and get good deals on the materials - usually don't return 100% on an investment. The best tend to be around 80%.
On top of the fact that your money is going towards an asset that isn't giving you much of a return, a house has costs that a rental simply doesn't have (or rather, it does have them, but they are wrapped into your rent) - closing costs as a buyer, realtor fees and closing costs as a seller, maintenance costs, and constantly escalating property taxes are examples of things that renters deal with only in an indirect sense.
NYT columnist David Leonhart says all this more eloquently than I ever could in:
There's an interactive calculator at the NYT that helps you apply Leonhart's criteria to your own area.
None of this is to say that home ownership is a bad decision for all people at all times. I'm looking to buy myself, but I'm not buying as an investment. For example, I would never think that it was OK to stop funding my retirement because my house will eventually fund it for me. Instead I'm buying because home ownership brings other values than money that a rental apartment would never give me and a rental home would cost more than the same home purchase (given 10 years).