It's an investment (anything you spend that much money on is an investment), but it's historically been a really lousy investment. Only twice in the past 100 years has there been a time when it earned much better than the rate of inflation, which makes sense. There's only so much money that people can spend on real estate, so it can't really rise much faster in price than, say, milk or butter or a car.
The two exception were right after WWII (lots of soldiers coming back and looking to start new lives) and the last 7 or 10 years (which is looking like a monumental bubble).
Wondering what the price on a given home will eventually shake out to be when the market settles down? My guess is you take the price it was selling for 10 years ago, then compound it 3% annually. That we are so far removed from that price right now in most cases tells you how much of a ride we're in for.
If you want to make money long-term, stocks have proven themselves for a century. And they are far easier to diversify yourself with. You can own $10k in shares in one stock, $5k in another, $15k in a third, etc.
When you own a single piece of real estate as an investment, all sorts of crappy things can happen. The local economy can tank, natural disaster, bad tenants, bad roof, bad foundation, bad anything. Any one of those setbacks can eat up years of earnings on your real estate investment. Most people can afford a disaster on one or two stocks. If disaster strikes in a real estate investment, you can be seriously fucked for years to come.
That's why so many people are going to get screwed in this downturn. The guy who has one or two rental properties and no other investments could lose hundreds of thousands of bucks.
If I sound smug, it's because I could've been that guy. I unloaded my one rental property in 2005 for $200k. The buyer did a $120k remodel on it. It's been for sale vacant for the last year at $280k. You don't have to be a math genius to see that somebody got fucked.
Buy the house you like and can afford right now. If you get tempted to upgrade it so much that it out prices everything in your neighborhood, either move, or upgrade it because it will make you happy.