Investments don't always work out, tough luck. That's obviously not the same as buying a sandwich.
If you are in a casual agreement with a friend and don't keep up your end then it's immoral.
If you have a contract that specifies expectations and consequences, then it's just a business deal.
The (predatory) school loan business works from contracts and they are obligated to keep up their side only as much as you are yours.
The real immorality is not accepting the consequences embedded in the contract to which you both agree to, it is that the United States has such a business in the first place.
Well actually second place I guess. When the student loan business started it was not predatory. But it got horribly abused, by the borrowers who would declare bankruptcy gaming that system, schools who raised rates because they knew loans were available, and the lenders who astroTurfed children into believing that it was a good bargain to exchange $200,000 at high interest for a Art History degree
― Abbie Hoffman
For example you should never ever vote on politicians that waste tax money. Some countries do that, but USA is not one of them since Americans thinks its moral to steal from the government so they don't blink an eye over every president using millions on his own or his wifes personal projects. "I'd also do that if I was the president" is how that gets perpetuated, you have to stop voting for any such candidate and only vote for those that promises to put an end to it. That would mean voting third party, but...
Bad countries are made when people let other people break the rules with impunity.
If the legal system fails to stop bad people from breaking rules it's up to us to stop them.
And we can't outright use force like the state can, so that means using subtle means of degrading their ability to break the rules.