> Because it's cheaper and more frequent.
The thing is that you can't put a price tag on national security. For example Ukraine got F16s. Good plane. However after a spat between Zelensky a Trump, Ukrainian F16 got no new updates to their jammers, which temporarily degraded the plane performance and Ukrainians needed to pull them out of frontlines.
Sometimes it is just better to fly on a plane which is not the top performer, but which you can control and manufacture or which a neighbor with same geopolitical problems like you can control and manufacture - i.e. Swedish SAAB JAS39
Same with space launches. Furthermore SpaceX is US company, so US government will want to know everything about the payload, probably down to the schematics and software, which is a big no-no for national security, but even for IP protection - what is stopping US government to supplying your IP to your US competitor? Nothing.