Gov't holds a high portion of student loans, private industry has all credit cards. It is no wonder which can be discharged more readily.
The unfettered access to credit card debt (non-restricted use), and the corrolary of higher rates are business practices that prices in there will be bad debts and discharges. Student loans by contrast have narrow access/use and lower rates.
It is also a misnomer student loans can't be discharged. It is hard to do, but it can be done. Also, there are pay as you earn programs that have discharge of remaining balance after 20 or 30 years. Also, PLSF and similar programs exist. Also military service can help here beyond an avenue for PLSF.
These may not be as palatable as bankruptcy for some, and not all options are available to all, but there is more available than most realize.