I mean you can phrase it this way. Or you can phrase it as homeowners are willing to play a premium for stability / forced savings. (And to be less generous, homeowners may be getting cheaper access to capital than otherwise available to a renter; espsecially as the homeowner locks in ~2% interest rate while a margin loan has increase to 10+% [1]).
However, for markets with low construction and strong demand I'm pretty sure home ownership comes out ahead. Like look at housing prices in the bay area historically vs current rents. That said, you need a handicap'd rental market for renting to be worse so the general situation is it's better _iff_ you invest the difference.
[1]: https://www.schwab.com/margin/margin-rates-and-requirements