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...
I also find it interesting that you also compared them to Microsoft, since Microsoft is now opening retail stores.
The key reason Apple isn't considered a monopoly is that even though they are huge, they don't' have a monopolistic position in their products. For smartphones they have a market share of ~20% worldwide and in the PC market the hold ~5%. Even on the country level, the numbers never get to a level where people would usually scream monopoly.
You could argue that they probably have monopolistic market share on the tablet market but most wouldn't consider that an industry in itself (yet) and they haven't exhibited the characteristics of a monopoly: price setting for the industry and an inability for new players to enter the market. It's actually possible to not be considered a monopoly even with a huge market share if you can prove you don't control the industry.
Apple's normal business model allows them to thrive without being a high volume business; their per device profit margin greatly exceed any competitor, so they can still be hugely profitable with low market share.