The rationale I've heard is that consumers benefit from having a local service location for the brand. Based on that logic, the state limits the franchises to avoid "ruinous competition" (not my phrase) that would threaten that consumer benefit.
The first time I heard the phrase "ruinous competition" used this way, I nearly jumped out of my chair.
But this is why the OP mentions the challenge that Tesla will have in providing local repair service. If it can crack that problem, it may open the door to manufacturer shops of other car models as well.
These laws came into existence to protect dealers from predatory actions taken by manufacturers against the public interest. They have their roots in the Great Depression era when Henry Ford dumped inventory on dealers with "offers they couldn't refuse."
There is a huge imbalance of power in this relationship. Since their creation the statutes have been captured by special interest just like every other regulation.