Its principally a corruption issue.
Western governments and corporations reinforce crony, incompetent governments in developing countries so that their resources can be exploited.
These crony governments then steal (literally) from the population who need it. Until the poor governance issues are resolved, a lot of foreign aid is wasted.