The idea is to make sure there is market efficiency, e.g. competition, in price throughout, so the consumer doesn't get screwed.
Now the idea of a franchise law like this one is done in a similar vain: it appears to ensure better competition for big car makers to bring their goods to consumers.
The problem is this law is written from a perspective of a couple major car companies that dominate the market.
There has always been an argument that a small player cannot be considered to wield market power, and that thus they should be allowed to be vertical. Apple for a long time avoided any anti-trust issues (while Microsoft didn't) even though it was very much vertical, by being small! Tesla presumably will use the same argument.
Bottom line there are two sides to laws like these: on the one hand, in Tesla's case, they seem anti-competitive. On the other hand they are made to bring about a kind of competition. Clearly the courts will need to resolve this...