That doesn't just apply to cars.
Manufacturers are understandably wary of unauthorized repairs when their products are under warranty, for several reasons. Most obvious is that their reputation rides on the job being done right. Secondly a botched repair job could cost a lot more to put right, and they shouldn't have to pay for that. Another is that authorized service agents need a considerable amount of infrastructure and training to provide that service, and are expecting a return on it. The company and its customers need those guys, so if they go out of business due to lack of work it's a problem. The service agents get access to all the information and parts they need through a special program set up for them. Providing the same stuff to random people off the street could be a lot more costly and difficult to manage. Finally there's the matter of proprietary information that could be misused, either by bad actors or simply due to incompetence.
In the 1980's I was doing freelance electronic repairs. Even back then getting service manuals and proprietary spare parts for consumer electronic devices wasn't easy. In many cases it just wasn't worth my time trying to repair stuff I wasn't familiar with. The local authorisized agent (who BTW is still the same guy today!) had the experience to diagnose common faults in minutes and already had the parts on hand. Furthermore he knew about important stuff that I wouldn't, such as all the capacitors in Sony video equipment that were required to be replaced under warranty whenever one was brought in for repair...
Tesla do supply the information needed to repair their vehicles, and many of their patents are open source so other manufactuers
could make compatible parts if they wanted. But it would be silly to do your own repairs on things that are covered by warranty.
So I don't know why you are singling out Tesla or even car makers in general for this criticism. The nature of mass produced high tech equipment practically guarantees that these issues will be present. I watched some videos done by
'the car car nut', who is a trained Toyota mechanic. Some of the repairs he has done are mind-bogglingly complex and full of traps. My own car repairs have often not turned out well either, which is why I take my 13 year old Leaf to the Nissan service center, who have technicans trained to work on them.
'Right to repair' sounds great until you realize what's involved in repairing a lot of modern equipment. The desire for higher performance at lower price has led to much greater complexity and trickier construction. I tried repairing a smartphone and even though I followed a YouTube video showing how to disassemble the phone I still broke it. Then I discovered that replacing the USB socket would be impossible without $1000 worth of equipment anyway... That's not the fault of the manufacturer. Nobody wants a phone that's twice as thick and does half as much just to make it easier to repair.