I doubt bailout was originally introduced to help the companies. I think the point is rather that not bailing out has worse outcomes and higher costs for the general population than wasting public money. Of course the companies need then still to stop doing their harmful operations, otherwise you need to bail them out again and then the costs of bailing them out will eventually become higher.
The issue is that this gives perverse incentives for companies, unless you also have proper regulation, which you should have anyway. The issue is that you don't.
But in this case I agree with you, because in addition to the costs, there are also huge benefits for the general population to letting these companies fail. Both in actual behaviour and power right now, but also as a future incentive for all other companies.