One major key to stop corruption is to have a strong legal framework and strong law enforcement
Legal frameworks don't work if no one cares to enforce them. The world runs on self interest only. The reason why you don't see this amount of rampant corruption outside of less developed nations is because the political economy outweighs other sources of wealth.
In the west; corruption at this scale would hurt the interests of capitalists that make their money in other ways so it doesn't happen.
In Somalia, Congo, Haiti etc... there isn't a side powerful enough that cares enough to prevent it since no one depends on the real economy.
The poorer the country is, the more corruption to be expected. People gotta eat.
It's either a fat economy with plenty of monopoly opportunities or the state coffers... whichever is the nearest.