If the banks had sunk then people's savings would have disappeared with them, and no-one would ever have felt safe putting their money in a bank ever again, so actually I think a bail out was kind of unavoidable.
What we should have done, many years back, is kept the retail banks separate from the investment banks.
Retail banks (which hold consumer funds) should not have been allowed to take large risks.
Investment banks could have been allowed to take large risks, on the understanding that if they gambled and lost they would not be bailed out (since it was only their money they were playing with).
I cannot understand why they are not separating retail and investment banking now.