The reason owner-occupied financing gets that tax benefit is to put owner-occupant buyers on a (more) equal footing with a commercial borrower as commercial interest is deductible as a business expense against income whether it’s startup costs, financing a factory, an airplane, or a rental house.
Perhaps interest should not be tax deductible. It's a huge subsidy to the banks and finance industry, which does not need any assistance, and has routinely caused destructive economic recessions.
It's a subsidy by proxy. The government forgoes tax revenue on money that goes to interest payments. People deliberately get loans for the interest deduction.
If you earned $100,000 in a year but paid $5,000 in mortgage interest, government will not collect taxes on that $5,000, because you gave it to the bank. The bank gets money, but government doesn't: makes little difference if you gave it to the government first (who then handed it on to a bank), or you gave it directly to the bank.
That doesn't make sense to me. Given an interest rate and a financed amount, I have to pay the same amount of mortgage interest to the bank whether it's tax deductible or not.