I don't see how this is different.
From the lender's perspective, the property is just like any other security: it reduces the risk of the lender so they can reduce interest rates and compete. The same with ownership of a company.
From each lendee's perspective, their loan comes at a cost: if the thing they are using as a security falls through, they could go bankrupt paying it back, and lose their home as part of that process.
From the government's perspective: they've written the rules this way so that loans are not taxed, presumably for a good reason. It would be good to know that reason before we start changing the rules.
When you buy a house with a mortgage, you are valuing the property as X, and the lender is also valuing the property as X. That's your cost, and no gain yet. If the value increases in a few years, it's unrealized gain.
Now, if you want to use the increased value to get a HELOC, that would be considered 'realizing the gains'. If eventually you pay off the mortgage and either sell the property or use it as a collateral to buy another property, that is also 'realizing the gains'.
My answer is to give them tax credits, transferrable tax credits, they could sell those credits and then pay the tax again, apply the credits to the tax cost of the underlying asset at the time of liquidation, or even transfer them with the asset to a third party as part of a sale. They could also even apply those credits as a rebate in the event they sell the asset for less than the original taxed amount.