What's a better long-term investment: home ownership or stocks? The short answer is that it's probably better to invest disposable income in the stock market, but most people don't have a whole lot of disposable income available. The more salient question for most families is whether renting or buying a home is a better investment, in which case buying is the obvious choice. Who wouldn't want to spend a little bit extra to recoup more than 50 percent* of their costs in equity?
For whatever reason this point is often overlooked when discussing the issue of renting vs buying, including in this post by Yglesias at Vox, perhaps because many of the people writing about urban issues are earning more than the average person and can afford to rent and still have money left over to invest elsewhere*. Lots of people don't have that luxury. For those of more modest means, the case for home ownership is similar to the case for getting rid of your car and moving to the city: it's clearly better to put your money into an asset than a liability.
That's not to say that there aren't benefits to renting. Lots of people don't want to be tied down to one city or one neighborhood, especially early in their careers, and the geographic mobility associated with renting can translate to greater economic mobility as well. Home ownership isn't a risk-free venture either, as the housing crisis made abundantly clear—there are good times and bad times (and good places and bad places) to purchase a home. But especially with the numerous ways government subsidizes home ownership, if you plan on sticking around your city for a while and are fairly confident you're not in the middle of a housing bubble, buying is absolutely the right choice.
I've talked about this in the past, but I think it's worth restating once in a while. Tens of millions of people enter their senior years with zero assets and no retirement savings, and we shouldn't dismiss the sizable difference that home ownership can make in those families' lives. The case for home ownership is strong even in lieu of government subsidies, so this isn't an argument in favor of them—I've said before that the mortgage interest tax deduction should be abolished entirely. Having arguments about the general merits of home ownership is silly though. It's common sense for the average family that it's better to buy, and I think urbanists undermine themselves and their message when they imply otherwise.
* This number can vary pretty widely, depending on interest rates and appreciation.
** I know that Yglesias owns a home and has written about the benefits of home ownership in the past, so this isn't a criticism of him specifically.