If I had to guess:
1. Perhaps because he can.
2. Because being a CEO of a public company comes with a lot of rules around disclosure of material public information and equal access. It takes a special kind of person to disregard general consel and just shitpost on twitter with zero review while directly responsible to shareholders. I don't know what kind of safe harbor Elon thinks Twitter offers but I doubt it applies to Github code review.