Indexes outperforming real estate is a highly simplistic view and doesn’t accurately reflect cash on cash returns, tax advantages and cash flow. $50k in an index vs $50k as a down payment on a cash flow property— the property is going to make as much in cash as your entire capital appreciation for the index. For an index to be better, it’s going to have to both appreciate at a higher rate than the house as well as pay dividends equal to the annual net from the house.
Comparing indexes and real estate shouldn’t discount the value of leverage, nor should it discount the cash flow from the asset. (In the situation you are commenting on though, the author buying a residence, I don’t disagree; I am commenting on real estate as an asset class in general.)
There is no guarantee that property values will go up, or even stay stable. Ask the people in NJ/CT/IL/KY and other non-booming places facing skyrocketing property taxes and stagnant home sale prices. Who knows, maybe an earthquake erases all those plump west coast gains tomorrow. The index fund investment is placing bets on economic activity as a whole, not picking winners and losers of real estate markets.