https://www.nasa.gov/news-release/mars-terraforming-not-poss...
Note the date on that: it was published in Nature on July 30 2018, and it wouldn't surprise me if somebody would've sent a preprint to Musk up to a month before then. The "pedo guy" tweet during the Thai cave rescue was July 18 2018. Musk's "funding secured" Tweet that the SEC sanctioned him over was Aug 7 2018. His appearance on the Joe Rogan podcast was September 2018. Most of his children and extramarital affairs post-date 2018; at that point, he only had the 5 with Justine Musk. Pre-2018, most of his ideas were crazy but at least engineering-focused on reasonable causes.
Musk has repeatedly said his ambition is to die on Mars. After a reputable scientific paper came out saying that if you step off Starship, that will be the very first thing you do, he doesn't really have anything to live for. Meanwhile he's given up so much for that goal (most notably, his first family) that it must feel pretty bitter to have invested so much in something impossible.
For that matter, the psychology is likely pretty similar to the core MAGA demographic, many of whom work hard all their life to achieve the American Dream and then find that the American Dream is going to other people.