IF Hugo Chavez had not been elected four times over, his regime would have been indefensible.

In fact, it would have borne a distinct resemblance to all the other Latin American regimes the West has defended happily down the decades. Some coverage of the Venezuelan's death has managed to overlook this technicality.

Did he have a habit of muzzling hostile media, stacking courts, packing the army with supporters, fiddling constitutions to his own advantage, and speaking – when not singing – incessantly? It would be naïve to pretend otherwise. Simply standing up to America doesn't win you the white hat automatically (though it doesn't hurt).

In some circles, nevertheless, it seems you can rob and slaughter your own people to your heart's content just as long as you tell Washington what it wants to hear. The Chilean regime of Augusto Pinochet, Margaret Thatcher's old friend, would be one murderous example. In the parlance beloved by foreign policy tough nuts, he was a son of a bitch, overthrower of an elected government – but he was our son of a bitch.

Chavez was neither of these things. When he faced a coup in 2002, the role played by Washington and Madrid was plain and barely denied. There were no lectures then on the inviolability of democracy. Chavez might, arguably, have provoked the coup as a trap for his opponents, but more fool them. They needed no second urging. Nor did the majority of Venezuelans when the time came to restore their leader.

His popularity – specifically with the great mass of the poor – was never in doubt. Nor was there ever proof, not a shred, that his four wins came because of the kind of vote-rigging the West is happy enough to tolerate in, say, Afghanistan. Chavez won, successively, with 56%, 60%, 63% and 54% of votes cast. We await the day when David Cameron will be able to say the same.

Still, the self-styled "21st-century socialist" wouldn't do. He had an inexcusable taste, it's true, for hugging real dictators such as Robert Mugabe and Colonel Gaddafi, and for speaking warmly of Iran's madcap president Mahmoud Ahmadinejad. But hold on: was that another Gaddafi with whom Tony Blair did his deal in the desert? Was it Reg Saddam the look-alike with whom Donald Rumsfeld shook hands? If Chavez's friendship with Fidel Castro showed poor taste, can we review the footage of British leaders fawning over the Saudis?

You can make certain charges stick against Chavez, in other words, but the attempt to paint him as uniquely unacceptable is silly. In the eyes of the West, in any case, his failings were not his real crimes. He was rude to American presidents, supported left-wing governments in Latin America, and redistributed wealth from a corrupt, petro-dollar elite to his country's poor. This made him a despot?

If so, it casts an interesting light on the pretensions of Western democracies. Simply to voice an anti-American position does not justify the old "my enemy's enemy is my friend" excuse. That kind of sloppy thinking is too common on what remains of the left. On the other hand, criticising the ways of American capitalism or America's military machine is not, so far as we know, yet a crime. You wouldn't have thought so, however, given reactions to Chavez.

He lifted a lot of people out of poverty: now there's a scoundrel. To the annoyance of his critics, he even got a testimonial from the World Bank for his pains. The bank has reckoned that between 1997 and 2011, Chavez cut the percentage of Venezuelans living in moderate poverty from 54% to 31%, and of those living in extreme poverty from 23% to 9%.

How's America doing on that score? Or Britain? According to a report last week by NBC News, 46 million Americans – 16 million of them children – are living below the poverty line. Much as here, close to one-quarter of those adults are in work but receiving what are, objectively, poverty wages. This is 49 years after President Lyndon Johnson declared a "war on poverty". No coup attempts are expected in Washington.

Chavez could also claim to have reduced illiteracy vastly, to have set up clinics in slums, and to have created a chain of discount grocery stores. As Tariq Ali wrote in a newspaper article recently, the book-loving president also marked the 400th anniversary in 2005 of the first publication of Don Quixote by distributing a million copies to his newly-literate people. You could call that a touch of working-class class.

However, he did arrange things so that he could stand for re-election as often as he liked. His programme of land nationalisation too often resembled appropriation. He stifled opposition by seizing TV stations or robbing dissident local administrations of funds. Even with oil wealth, his running of the economy was not impeccable. You could conclude, therefore, that Chavez was far from perfect. Then you would have to ask a question: by whose yardstick?

The truly troubling thing about this leader was perhaps his charisma – or rather, his use of that charisma. Conservatives don't have this problem. Leadership cults of the Thatcher, Reagan or Blair variety are to their taste. When the people's man is proclaiming socialism while defining himself as indispensable, however, there is a problem. Castro is an example. If the revolution has succeeded, the maximum leader is no longer required. Somehow that moment never quite arrives.

Of what does devotion to a leader comprise? In the case of Chavez you could say that he kept his end of a bargain with the people. Did that entitle him to take a proprietorial view of a government and of a country? Of course not. But those who will mourn when Thatcher goes never flinched when she spoke autocratically of her government and her nation.

A lot depends on the side of the line you occupy. Those who extol Winston Churchill, the war leader, tend to overlook his role in the 1926 general strike. Those Americans who insist, weirdly, that Ronald Reagan was the greatest president of the 20th century forget how he ran up a vast national debt. But Churchill's side won their strike; Reagan's supporters got rich in the 1980s. Both offered that indefinable thing: leadership.

Opponents of Chavez would often accuse him of fraud yet fail, time and again, to provide the evidence. Of itself, that counts as a kind of tribute. The huge crowds of mourners in the streets of Caracas were a better mark of his significance. From this distance you can no doubt regret that his taste for power sometimes got the better of him, yet also remember what he was up against. Time and again, the "democrats" ranged against him called for American military intervention.

He wasn't perfect: any other nominations in that category? Greatness in a leader is not equivalent to moral purity. Even old Thatcherites know that much. To a poor Venezuelan, nevertheless, there is no need to forgive Chavez for his imperfections. Of how many other leaders could the same be said?

Ask again on the day that Thatcher leaves us.