So with a 401k loan, which is kind of this, you are limited to borrowing against it by like only up to 50% of its face value due to factors such as market volatility. And then all payments made to that loan are with alreaey taxed income, so you aren't securing money in any way that dodges taxation.
Also using shareholdings is no different from using a house or property as collateral... property equity has unrealized value until it is sold too. One might argue you pay property taxes on that equity, but ideally, the company behind the stocks you own pays property taxes for its ownings annually, so that's still happening. So the real problem is large companies dodging taxes due to exploiting broken tax code loopholes.