First of all, bankruptcy doesn't mean that the creditors don't get paid in full. Often they do. Bankruptcy is a means of preserving value and distributing it fairly. Chapter 11 bankruptcy, in particular, is used to restructure a company and keep it operating. All of Trump's bankruptcies have gone through Chapter 11 and come out on the other side as still functioning businesses. Bankruptcy just provided a mechanism for distributing some or all of the ownership to the creditors through an ordered process with judicial oversight.
Second, it is almost a tautology that if a business is wound up such that its creditors have been paid in full, that the owners of the business have left value on the table. The equity value is equal to a call option on the enterprise value with a strike price equal to the value of the debt. Unwinding the business is equivalent to exercising the call option early, unless of course it is timed when there is no debt, which extinguishes option time value. It is usually better for the owners to sell the business to somebody else or to keep going. The main point is that the creditors are paid to take the downside risk of the company after the equity holders have taken their hit. Their protections are contractual, and to the extent the managers can extract value consistent with the contractual terms, then they should do so. In fact, they have a fiduciary obligation to do so for the owners.