I bought an apartment in San Francisco in 2001 and frankly, it was one of the best decisions I've ever made. Before I did so, I calculated out the cost difference of renting vs. buying. After taxes, my living expenses were only a few thousand dollars more a year to buy vs. renting.
If I want to move, I don't have to sell my place, I can simply rent it out. Given current rates, I can do so for more than my monthly mortgage payment. Not only that, but my property is worth about 40% more than what I paid for it. I can actually use my equity in my house to finance another home and flip one to a rental.
Maybe purchasing isn't for everyone, but it certainly is for some. In the end, it depends on your finance situation and location.