My favorite rebuttal to that argument is this Q&A: https://money.stackexchange.com/questions/89245/should-i-buy...
To quote the top answer:
> Ask them if you already owned the house, would they be advising you to take out a mortgage in order to invest elsewhere. If not, ask them to explain the difference between taking out a mortgage on the day you buy the house and taking the same mortgage out the day afterwards.
If I owned a house (with no mortgage), I wouldn’t take out a mortgage on it just to invest those funds in the market. Some people might, but that’s too much risk for me.
If your mortgage is big enough (over 750k as of the last tax bill, which is not that uncommon in some real estate markets) or small enough (so you don't itemize your tax deductions; that roughly corresponds to mortgages under $300k for married couples, I would think), then putting money into paying off the mortgage has a guaranteed 4% _after-tax_ return for some number of years that depends on where you are in your mortgage payoff cycle.
Would you buy a government bond on those terms in the market?
There are obviously liquidity issues with home equity that are much less of a problem with bonds, but I am also not seeing any 4.5% (generously assuming a 12.5% marginal rate on your bond interest) US treasuries bonds in the market right now, at any maturity.
You're still losing a little but you will be ready for emergency home fixes & getting sacked with random specials from your city which are usually at a higher interest rate.
Of course if you have tons of cash, then for sure throw it in some ETFs in the market.
Why would I dump $x00,000 into home equity when I could leverage that money for decades are earn more in the market?
It seems like a win win, at least for people who have access to 4% interest.