They do pay capital gains, even if a loan differs it. If the individual dies before repaying the loan, their estate pays a tax rate much higher than capital gains as it cashes out assets to settle its debts.
I'm not sure how, but the "margin debt is an infinite free money hack" somehow caught on and won't go away. It's not a free money hack, it's debt that must be repaid with income. Which is always taxable.