I don't know of any other consumable where I have to effectively repurchase it every few decades or I lose it.
For instance, looking at buying a typical home in my market, one would have to pay around $2k in taxes and insurance per month. That's 2/3 of my current rent, and doesn't include maintenance. That's after the mortgage is paid off. That's on a $1.5M house. That $1.5M would earn you $82,500/year in risk free interest right now, or $6,875/mo. That's nearly enough to rent an equivalent house even after you've paid the income taxes.
Also probably important to consider that most people who buy homes cannot do so without a mortgage. So you're not even really comparing it to whatever else you might do with that money (well, aside from the down payment); it's just a pure expense. Sure, unless you have an interest-only loan, you're also putting principal into it every month (which you could put in the S&P instead), but that's sometimes better than giving a similar amount to a landlord, depending on housing economics in your area.