Taxing unrealized gains will be extremely complex, and given that they aren't allowing us to deduct unrealized losses its a pretty shitty setup for the taxpayer.
We need to drastically simplify our tax code rather than further increase its complexity.
And there lies the loophole. These loans are often structured as some kind of business expense that can be paid from pre-tax income.
So, ultra rich people get to double dip here. No taxes on selling stocks for money, as there's a loan, plus no taxes on the income for paying it off.
Also if you sell stocks you always pay tax on the capital gains regardless if there is a loan or not.