Why doesn't the government sell the debt for more or hold the debt themselves
They sell the debt (at a huge discount) to get it off their books and draw a line under that money. Standard business practice. They probably can't get any more as the buyers won't pay more (I assume it is like an auction process, the buyers will only pay what they think they can profit from).
There was a piece on R4 Moneybox recently about the first type of student loans that have been sold to Eurido, who have bought what are often unenforceable loans because the students who took them out have constantly deferred and paid back little or nothing because they never had to due to being below the earnings threshold. Now Euridio are employing dishonest tactics to try and recover the loans - offering discount settlements to the borrowers without mentioning that people aren't actually legally required to pay anything and often then loans are due to be written off in a couple of years anyway.
If Eurido bought a load of £10k loans for £500 each and a minority pay them £2k, they probably make a profit, which is how they work.
They were talking to a man in his late 40s whose loan will be written off in a couple of years and he still has a loan of about £10k outstanding, but he has never earned enough to pay it back so legally is not required to pay anything but they were trying to trick him into paying about £2-4k.
This is why you really have to understand how the system works, so you can make an informed decision about the money borrowed and stop thinking it about a debt.
But from the lender's (ie the UK taxpayer) point of view, you do have to be concerned about all these loans made that will never be repaid in full.
It is also unfair that people with high but not stellar salaries overpay massively compared to everyone else. In the MSE example linked to in this thread, people who start on £25-30k and experience modest salary rises will only pay a minority of their loan and not pay any interest.
People who start on a high salary, eg £50k and go on to earn a lot, will pay back all their loan quite quickly and pay some interest, but those who start on about £35-40k and receive salary increases take a lot longer to pay off their loan and hence pay much more interest so you don't want to be in this group.
But student loans are like a lot of government policies that there is unfairness in the system. I know it is all very complicated, but sometimes I wonder if they think things through properly.
Like the high income child benefit charge, where two people on £49k keep all their CB but a sole earner on £60k loses all theirs, or the 10p tax fiasco a few years ago, where a tax cut actually raised taxes for people on NMW and slightly above but cut it for higher earners. I managed to work out the impact on me (a middle earner) and DP (earning slightly above NMW) while listening to BBC Moneybox talking about in the car, so either it was deliberate, or they really didn't do the basic maths.