During the pandemic Tesla made a sizable amount of money selling EV (not EV but Carbon) credits to combustion engine manufacturers, and I presume Elon thought outside interest in the super charger network was a similar lip service while they pumped out gas powered vehicles. In Tesla's perfect world they would never need to fully ramp up car production and instead license their tech to others, a super charger network that's charging vehicles that payed a license to Tesla, is worth 'giving away.'
Instead multiple manufacturers are ramping up their own EV production with all their previous car knowhow while Tesla's big breakthroughs never materialized. Like their full self driving using only cameras. I do wonder how much the success of SpaceX affected Musk, as I bet he's said "How hard can it be, it's not rocket science!" to problems that turned out to be much harder than rocket science.
ETA: According to Carbon Credits, "Elon Musk’s Tesla generated a substantial $1.79 billion from carbon credit sales last year, as revealed in their Q4 2023 and annual financial report, bringing its total earnings from such credits since 2009 to nearly $9 billion."
Tesla Hits Record High Sales from Carbon Credits at $1.79B | Carbon Credits Feb 2024