Dealer's Choice[0] explains why these laws were originally passed; Ford and GM forced dealerships to accept new cars during the 1920 depression and the Great Depression. The laws persist because car dealerships are well-connected politically and donate heavily to campaigns; it's just a special interest group protecting their business model.
[0] https://www.newyorker.com/magazine/2006/09/04/dealers-choice...