It seems a patently unfair way to tax. One should be able to deduct the private sale proceeds, if dealers get to benefit from customers not getting taxed on trade-in.
The dealer lobbying groups keep this tax advantage in place at tremendous lobbying expense. Effectively, it is a conduit of money from car buyers to politician election campaigns.
It’s been constitutionally challenged in a few state courts and I recall one that got the law changed to allow car buyers to deduct sales tax from a private sale as long as it was done within a set period (like 90 days). Maybe LA.