The first basic problem is the tender process. There's nothing in the tender process that stops companies who have failed on other contracts tendering for different contracts. The only red flag is a particularly low price. Most of the companies that bid for government contracts are experts at the tender process and once they are successful in winning one, it's easy to win others.
The second basic problem is the service level agreements. The penalty system is far tighter now than it used to be, but there's nothing to prevent a company paying out monies in the form of wages, bonuses and dividends even on failing contracts. It takes so long to activate penalty clauses because nobody wants the contract to fail. Even if a contract has staged payments with penalty criteria, the company can still keep paying out. Not all companies are like Carillion which is basically a merger of some genuine big name companies. At the end of the day many are just hedge funds. Plenty of hedge funds can make enough money without completing the contract and to risk going bust. They are the modern day carpetbaggers.
As far as HS2 is concerned, The other companies involved in HS2 have already told the government that they can cover Carillion's contract. That was done as part of the contingency planning last week. In due course the government will argue that the HS2 contract was allowed to be awarded to Carillon in an effort to bolster the company whilst it tried to find a solution to its financial problems. This is almost standard practice because large companies have multiple contracts running and they are often dependent on one another. By awarding Carillion a contract for HS2 worth more than a billion pounds, it will have helped other contracts to continue. That's big business and the risks are high.
The government will also argue it was trying to avoid the need to take in house hundreds of contracts that were in danger of failing. That strategy failed and the contracts are being brought in house now. A lot of the jobs will be secure for the near future, but it will be the government paying the wages. At some point the future of each contract will be decided and that's the point jobs will be at serious risk.
Public sector contracts are a source of money for private companies. A public sector contract is the equivalent of a cheap loan. And yes, public sector contracts are a bottomless money pit.
One further point. The vast majority of workers on public sector contracts are not well paid. So those workers will not have high incomes when they retire. Many will require top ups from the State in the form of Pension Credit and Housing Benefit, etc. So any 'savings' from the government not employing these workers in the public sector are vastly reduced.
Smoke and mirrors.