The reason student loans can't be discharged during bankruptcy is because the value of the degree can't be repossessed by a bank like a house or a car if you default. You attend college to learn and grow, not to pass an HR screening.
I could very easily acquire a job as a developer simply by knowing the material and how to write code - how I choose to come by that knowledge is my own prerogative but if I take out a loan from a bank to acquire that knowledge then they have nothing to repossess.
You don't attend college for a degree you attend it for the knowledge and experience you gain - a degree is worthless, it can't be resold if a bank were to "take posession" of it.
And trust me if banks and financial institutions could create second-hand markets and derivatives for degrees they would, but that would obviously be pointless. I can't just buy and sell PhD's on e-trade.