As a programmer you should know that extremely complex systems like the world can not ever be managed by a small group of super clever beings.
This has been the fallacy of each and every of "I'm smart you're not, I'll run things" philosophies originally invented by Plato and perfected by Marx.
The world is a complex system managed by 6 billion autonomous beings. Together these 6 billion autonomous beings for an extremely smart mega intelligence. While you, I and our "leaders" may be smarter than the vast majority of these individuals. Together though is another story.
I agree with your point about corruption as long as we assume the presence of a regulating entity. Corruption is essentially the markets way of calculating a price on overcoming social engineering.
But without regulators in the first place it would not exist and would simply be just other transaction between two or more parties.
Your view that the free market works wonderfully if left alone is simply naive. The real world is simply more complex than that.
In fact, your belief that there even is such a thing as a free market is naive and ignores the very real fact that corruption is inevitable and businesses seek out regulation to protect themselves from competitors destroying the very free market they so claim to love. Any truly free market is simply a temporary state of existence destined to die as soon as corruption takes hold, which it always does.