Even without considering the global links in corruption, though, we can ask "Why do countries stay corrupt, given that nearly everyone would prefer less corruption?" and there are answers that still readily available: Firstly, there is seemingly a game-theoretic drive towards being corrupt if you see others succeeding through corruption; and secondly, corruption succeeds as long as there is the political will for it to continue.
So in some sense, the problem of corruption can be reduced to the problem of electing non-corrupt leaders. This has important implications in terms of valuing electoral systems that truly represent the wishes of the population (and don't, for example, devolve into a "lesser of two evils" political gridlock), and it confirms the simple observation that in a country which is a dictatorship, the dictator will engineer the system of corruption around themselves, but it also hints at a problem where corruption is so endemic in a society that all voters accept that their politicians will be as corrupt as them, especially if they've been let down in the past.
For this latter problem, though, I can't help wondering if a valid strategy would be for a political candidate to say "Vote for me and I will be extremely corrupt, enriching myself and my family at the country's expense, but I will also root out all corruption among office holders lower than the national parliament/congress." (This strategy is reminiscent of one used famously and successfully on a British game show[0]). So police and doctors and mayors would all be fully investigated for corruption (based on an anonymous tip-off system, and undercover sting operations) meaning the average person's experience of corruption would be greatly reduced. It would then be a job of a future leader (or a later term) to remove the deliberate loophole and make the laws apply even to the highest offices.
There are a few potential problems I can see with this system, but I think they can be mitigated. Firstly, there is no guarantee that the candidate suggesting this approach will actually implement it if elected, but there is a financial incentive to prevent untaxed bribes so that the candidate has more tax revenue to embezzle for themselves. Next, it is possible that a candidate might want low level corruption so that all potential challengers are equally tainted and can't campaign on the basis of their own integrity; however that requires a lot of speculative long-term thinking that most corrupt leaders aren't particularly good at. Finally, there is a risk that an anti-corruption campaign is merely used as a smokescreen for arresting political enemies, so there would have to be safeguards built into the program, such as requiring video evidence and randomly chosen juries.
[0] https://blogs.cornell.edu/info2040/2014/09/30/split-or-steal...