Obviously the comparison accounts for that. The rental owns the equivalent of the value of the house in other assests.
It’s very easily to live a paycheck-to-paycheck lifestyle (even in higher incomes, people adapt to expensive lifestyles very quickly) and spend a lot of money on vacations, cars, eating out etc... and only consider your living costs as a passive constant that you pay no attention to. I imagine most people think of spending and budget allocation in this way, so for them having a mortgage makes more sense.
Rather if you think of every purchase in terms of your total net worth and you spend a significant amount of your income towards saving, investments, and assets that don’t depreciate, then sure, maybe renting is your better option.