This was years in the making. He basically made a $200 million bet on the USG, one that translated into hundreds of billions. This was all calculated, and the veneer of government inefficiency was good enough to mask his actual objectives.
I can say this confidently because that's what I would have done too, and I'm not half as smart as him (given that I haven't built a Paypal or a SpaceX myself). That's what anyone in such a privileged position would have done. The upside to doing it that way was just that much massive.