Some of the employees in those institutions are actually connected politically locally and they favor insiders from their party. Others want the press-release and don't give a fuck if the project actually gets completed or if it impacts people. They're just as involved in politics as the locals: I'll give you this loan so you have cash to do whatever and you help me with this project I'm pushing throughout the region.
Sounds like a regular day at the office I guess but dunno I thought people who worked in these institutions wanted to do good. I guess I ate up some propaganda and never questioned it until I saw it first-hand through my wife's experience.
The loans are a way to circumvent budgeting. Not sure on specifics but it's easier for them to accept the loan vs getting cash handed to them by the country's comptroller (Contraloria is the entity in Spanish).
You go to the IMF when no one wants to loan you money.