What is the point of people being allowed to declare themselves bankrupt?

batteryacid asked: Is it a tool to stimulate the economy, because so many people mismanage their money and too many people in debt would create a freeze in spending and enterprise?

I ask because it seems unfair that people who take on the responsibility of credit can just declare themselves bankrupt,
with light penalties, such as not [...]