Answer: It wasn't always that way. Until 1976, all education loans were dischargeable in bankruptcy. But that year Congress began requiring borrowers to wait at least five years before they could discharge federal student loans. Since 1998, however, borrowers have been unable ever to discharge federal student loans, and in 2005 the then-Republican-controlled Congress made private loans almost impossible to discharge. Essentially, borrowers must prove something pretty close to impossible: that they can't repay and will never be able to, but the standard is vague. And litigating in bankruptcy court may be impossible financially for many in those circumstances - i.e. they can't pay their bills so they can't afford to hire an attorney.
Virtually any other kind of debt — including medical bills, mortgage, credit cards and car loans, even gambling losses— can be discharged in bankruptcy, allowing the "honest but unlucky" a second chance to restore their financial lives.