I've done the math of rent vs. buy four different times when I was living in four different states (MA, CA, TX, CT) and the net net of my analysis is that it is financially better to own, but money is not the only currency to measure by.
From a dollar perspective, in the states mentioned, it was smarter to buy vs. rent as long as I stayed in the home more than 3 years. Every time, by a lot of money (30% or more, up to 50% in CA). Not only price appreciation helped make ownership better, but tax benefits and ancillary costs (garage, storage unit) too.
I think what we are realizing is that many times other currencies are just as important to us: freedom to travel or move, reducing the hassle-factor, freedom from worry or anxiety of ownership, freedom from home repair responsibility, taxes, HOA, etc. Also life style. Its harder sometimes to be spontaneous or opportunistic with home ownership.
Where I live now, (Austin, TX), in financial terms only, we have experienced a 6% annual home appreciation for the past 30 years. That doesn't sound like much because it is slow and steady, but on a $300,000 home, with 20% down at the time of purchase, after just four years of ownership, that's roughly a 21% ROI and almost a 100% ROE, including home purchase closing costs and minor maintenance. This is a major wealth building component.
When asked, I tell people to wait to purchase a home until you can meet some minimum financial milestones so that your home purchase doesn't leave you vulnerable or make you house poor (20% down so no PMI, etc). In the early years, live beneath your means, save up your money, build a nest egg. Then purchase a home that is well within your means, make it nice, take care of it and stay in it as long as you can. IF you can keep all your home related costs (mortgage, utilities, HOA, taxes, insurance, etc) to less than 20% of your take home pay, you have a real good shot of building real wealth and living financially free to still pursue your dreams and goals.