Money gets absconded/pocketed away due to corruption.
Government gets overthrown.
IMF says too bad, you still owe us money.
https://www.cadtm.org/World-Bank-and-IMF-support-to-dictator...
TLDR: there are geopolitics at play, the IMF does not just simply give out loans.
In Argentina, the IMF gave a pro-US government unfettered amounts of money to spend politically the face of elections, but with a debt maturity so short (4 years) and an unfeasible economic plan that the country was into default again 2 years later, and is still trying to renegotiate the balance of that debt.
The IMF existence is pure moral hazard, and even though Argentina would suffer greatly from default its IMF debt, part of me wants them to suffer the consequences of bad lending as well, for the which they never paid a price for politically or institutionally.
Borrowing any other denomination is national suicide.
The IMF should be defunded and disbanded.
Also, zero interest loans from the IMF are quite rare.