The concept and laws of bankruptcy have been around for quite some time.
How long, exactly?
The first English bankruptcy law is believed to have been established in the early 1500’s.
Bankruptcy was initially created to help creditors not debtors. In fact, in these early cases, debtors were subject to incarceration for failing to pay their debts.  This came to be known as “debtor’s prison.”

The first bankruptcy act enacted by the United States congress was in 1800, though it was only for involuntary proceedings.

From the 1800’s through a variety of incarnations to the bankruptcy code, the various forms of relief were broadened to include help for consumers as well as businesses.

In October of 2005, sweeping changes were made to the bankruptcy code, designed to (at least in part) hamper the ability of consumers to get chapter 7 (“fresh start”) bankruptcy relief.  Consumers would be required to pass an income-eligibility test (commonly known as the “means test”) and would have to comply with certain educational requirements, before being permitted to go bankrupt.

But bankruptcy law dates back much, much further back in time than the early 1500’s. For the “believers” among you, consider the following excerpt from The Old Testament, Deuteronomy, section 15: verse 1-2:
“At the end of every seven years thou shalt make a release. And this is the manner of the release; every creditor shall release that which he hath lent unto his neighbor; he shall not exact it of his neighbor and brother; because the Lord’s release hath been proclaimed.”
Interestingly, modern bankruptcy laws (until very recently) provided that one could not obtain a bankruptcy discharge (under chapter 7) if a prior case had been filed within 7 years time (a possible throw-back to bankruptcy’s biblical roots.)  Under present law, that restriction has been expanded to 8 years time.
So is bankruptcy immoral? Absolutely not.  Realize that not only is bankruptcy sanctioned by the U.S. federal government (you are exercising your rights under federal law) but, for the believers among you, it is sanctioned by a much “higher authority.”