W'pedia could be clearer on government's role in SpaceX, but the funding appears to have been non-government until SpaceX started winning NASA contracts (for launches) in 2006.
At the least, Obama didn't shut down what Bush started, but then too, Trump didn't shut down what Obama continued during his 8 years. Allowing SpaceX to move on to launching humans pretty much is on Trump, given his 3+ years in office. And BTW, every astronaut launched by SpaceX is an astronaut not launched in a Russian Soyuz, i.e. $$ lost to Russia.