A completely free economy nor a planned economy are ideal; a mix of the two with proper leadership seems to be the path to success. (EDIT: Most importantly, those at the top must be genuine, honest, and transparent. Corruption is a poison in this case, and must be avoided at all costs. You must want success for the stakeholders.)
How do you ensure "decent people" are always at the top? I don't know. I'm not a terribly big fan of Obama (drone strikes, supporting the NSA), but he's done an OK job. Now Elizabeth Warren and Rich Cordway (director of the Consumer Financial Protection Bureau)? They're kicking all sorts of ass for the general public.
Find good people. Put them in charge. Get out of their way.
Then we have the 1979 government bailout of Chrysler...the 2009 government bailout of Chrysler...this company seems to need a bailout every thirty years...with some of the same talking heads shouting how the banks need to be bailed out denouncing the "socialism" of bailing out Chrysler.
Of course there was the 1971 government bailout of Lockheed as well.
Every year the US government sends $500 million to Iowa in direct farm subsidies...Senators Jodi Ernst and Chuck Grassley are against "socialist" measures that tend to go more to big cities in other states, but of course hypocritically demand the government give corporate welfare to the farmers in their state. Texas gets $400 million a year in direct farm subsidies, with the same hypocrisy surrounding it. At least Democrats are honest about what they're doing.
Then of course we have the net neutrality debates, with the backers of the AT&T/Verizon monopolists saying "get the government hands off the Internet". This is a laugh to people like me (and some others here I'm sure), who remember the days of ARPAnet and NSFnet and sri-nic.arpa and nic.ddn.mil and so forth.
Some people act like Red Guard students are still marching through Peking, throwing portraits of the Buddha in bonfires during a Smash the Four Olds campaign. In the modern day, the economy of the PRC does not operate all that differently than that of the US or Germany or some other country in terms of a "free market". The only different for the PRC is its economy has been booming since the 1980s much more than these other economies. Since 1990, every year the PRC's economy has grown 7% or more. That this might slow down for this quarter is what is eliciting surprise. Looking at the US economic downturns after 2000, and after 2008, it seems incredible that so many American pundits point to a slow quarter in the PRC's growth as signs of how they've been heading in the wrong direction all along etc. 7-14% economic growth every year since 1990 looks pretty good to me.
For examples in planned economies, USSR had a lot of examples, and this article is another. For examples in otherwise-freemarket-but-not-in-this-case economies, see "too big to fail" situation with bank bailouts, and your own example on USA military industrial complex - where failed projects get propped up instead of allowing them to die as they should, thus in the end harming the long-run perspective in the whole sector.
With hindsight it would have been better for the industry to decline gradually than laying off everyone at once.
Look at a large corporation like IBM some floundering business units persist for decades because of the internal political cost of ending them when economically it is the prudent thing to do.
Bankruptcies are an important instrument for the overall health of the economy. Yes, there is a short term hurt during the reallocation. But if many companies are in trouble keeping afloat, then a few of them sinking will free up resources (workers, capital, materials, land/buildings) so those resources are cheaper for the remaining, slightly more successful companies, allowing them to come back above water.