Students do default on student loans, even though they cannot be discharged in bankruptcy. 14.7% of students who started repayment in 2010 defaulted within 3 years. (Source: http://www2.ed.gov/offices/OSFAP/defaultmanagement/cdr.html)
If the government did not guarantee and subsidize the loans, interest rates would be higher and/or banks would be more careful which students they lent to.