Corruption and Poverty-misplaced causality

When I go to a developing country like India or Argentina everyone talks about how corruption keeps their country poor.
In developed countries the condescending lot talks about why the rest of the world is poor because they are corrupt, as if being in a developed world gives them some superior morality of some kind (even bums from developed countries take undeserved pride in their wonderful country).

They got the causality backwards.

Poor people are corrupt. When your basic needs are met; you stop being corrupt. As countries advance to riches by accumulation of capital, the percentage of people whose basic needs are met increases, and they automatically stop being corrupt. Even people living on the streets have some fear and respect for the law-and if they are living tolerably well; will not risk breaking it. People in the middle class are more intelligent- if they are living okay, they will avoid taking bribes and being corrupt.
The media skews it all up for us, to confuse us. They show the Madoffs and other rich and well-to-do people indulging in fooling people; but for every one Madoff, there are tens of thousands of rich people who are not corrupt. In general, newspeople and reporters and sensationalists, and you are apt to draw a large number of false conclusions if you trust what they show you.

In summary-poverty and bad conditions of life lead to corruption; and the best way to remove corruption is to make people rich, allowing accumulation of capital, respect for private property, etc. - following the recipe outlined by Smith.