The tax advantage is up to comical 250k that will be promptly eaten away by brokerage fees, transfer fees and other god knows what fees, on top of all the house maintanence costs over those years.
Those who have a million or two but a house not because it's good for financials, but because they can't stand cranny rentals. Those with bare minimum money jump into a mortgage because for them it's the only efficient financial instrument available (a margin trading account essentially). If they tried to open such an account with a brokerage, they would be told no after looking at their net worth.