SolarCity is one of the best examples of tax break grubbing. The entire business model of SolarCity is gerrymandered to collect tax breaks and subsidies, not to provide value to their customers. They lease the solar panels to you, and in that way, they are the owners of the panels, and all the government benefits go to them, not the customer. There is very little benefit to being a SolarCity customer.
As for Tesla, it gets by on two big tax breaks. One is that California requires electric vehicle credits, which he sells to other car companies. The second is they get a tax break for offering a car that can be recharged in a few minutes, hence his "battery swap" show last year. The battery swapping will never actually be implemented, but that isn't required by the writers of the tax break.
SpaceX, however, is largely legit. SpaceX got some seed money early on, but no more than others that signed up for the program. SpaceX has grown because they legitimately have a better product.
While I wish entrepreneurs woulod just focus on what their customers want, I can’t really blame Musk and others for taking the fruit that is offered by government. The problem starts with government, not the businesses.