The west's proudest export to the Islamic world this past decade has been democracy. That is, not real democracy, which is too complicated, but elections. They have been exported at the point of a gun and a missile to Iraq and Afghanistan, to "nation-build" these states and hence "defeat terror". When apologists are challenged to show some good resulting from the shambles, they invariably reply: "It has given Iraqis and Afghans freedom to vote."

As British electors don democratic finery and troop to the polls next month, elections in both war-torn countries are looking sick. Last month's poll in Iraq, blessed (or cursed) with a Westminster-style constitution, has failed to yield a coherent government. It appeared to show the incumbent prime minister, Nouri al-Maliki, just beaten by his predecessor, Ayad Allawi. If so, it would be a remarkable case of a developing world democracy actually ejecting a sitting leader. In that respect, Iraq would be ahead of Britain, where the opposition must lead by at least 10 percentage points to be certain of power.

For the time being, Baghdad's government has been in abeyance. The Sunni militias, reportedly backed by al‑Qaida, have returned to the streets, and the death rate is again soaring. Kurdistan is all but a separate country, and the odds are on the Sunnis being forced back into a semi-autonomous region. Tens of thousands of Iraqis have died and millions been driven from their homes – including almost all Iraq's ancient population of Christians. The import of democracy has so far just inflamed local tension and fuelled fundamentalism. Like precious porcelain, elections were exported without instructions on their care. In the absence of adequate security, they are little more than tribal plebiscites.

At least in Iraq western troops are leaving the country to its fate. The west's guilt at the mayhem left behind will start to diminish with time. People will blame George Bush and Tony Blair, leaving them, as they wish, to render their account not to the Iraqis but only to God.

In Afghanistan, a similar saga has been running for nine years, and is growing ever more tragic. Last year saw the deaths of more Afghans (2,412) and more western troops (520) than since the 2001 invasion. Nato is locked in a struggle to hold Helmand province for the government of the president, Hamid Karzai, against insurgents who can wait as long as they like to defeat the hated invaders.

Nato is only now seeking control, nine years on, of the country's second city of Kandahar, in which the Taliban is dominant and the president's brother, Ahmed Wali Karzai, is the power broker. Karzai is said to have told local elders that there will be no assault on Kandahar "without their permission". If Nato cannot negotiate a deal over the city, rather than reduce it to rubble, its mission is surely doomed.

The fact that Hamid Karzai was elected, by whatever dubious means, seems to infuriate western leaders. Barack Obama, Gordon Brown and their respective foreign ministers rage and telephone and pay visits and expostulate. The repetitive criticism hurled at Karzai for being corrupt and in the pocket of drug lords has become near comical, not least because of his eccentric response. Last week he threatened privately to swear allegiance to the Taliban himself (which might solve many problems).

The west is constantly telling Karzai to "clean up his act" or, as the New York Times harrumphs, "stop doing whatever he and his aides choose". This is not because there is any likelihood of his obeying, but to help make the domestic case for the war look less shaky. As the joke in Kabul goes, as long as the west pretends to uphold his regime, Karzai must "pretend to be Swedish". He is America's exhibit A for world democracy. The idea that he might regard himself as the elected representative of the Afghan people, warts and all, with a future to consider and his neck on the line, is beyond consideration.

Democracy in both America and Britain is coming under scrutiny these days. Quite apart from the antics of MPs and congressmen, it is said to be sliding towards oligarchy, with increasing overtones of autocracy. Money and its power over technology are making elections unfair. The military-industrial complex is as powerful as ever, having adopted "the menace of global terrorism" as its casus belli. Lobbying and corruption are polluting the government process. In a nutshell, democracy is not in good shape.

How strange to choose this moment to export it, least of all to countries that have never experienced it in their history. The west not only exports the stuff, it does so with massive, thuggish violence, the antithesis of how self-government should mature in any polity. The tortured justification in Iraq and Afghanistan is that elections will somehow sanctify a "war against terrorism" waged on someone else's soil. The resulting death and destruction have been appalling. Never can an end, however noble, have so failed to justify the means of achieving it.

The high-minded attacks on corruption in Muslim states from London and Washington is futile. In most countries corruption is the lubricant of power. Nor is the west that clean. Britain showered corruption on the Saudis to obtain arms contracts. The activities of American firms in "rebuilding" Iraq were wholly corrupt. In 2001 the British in Kabul – in the person of Clare Short no less – were put in charge of suppressing Afghan opium, fuel of most of that country's corruption. Britain allowed it to continue, when the Taliban had been in the process of stamping it out.

The Tories and Liberal Democrats are dishonest to say that the Afghan war is justified "provided" Karzai ends corruption, stops rigging elections, and trains his army and police. None of this will happen, and is merely cover to avoid saying what these politicians know to be true – that British soldiers are dying for a dud hypothetical.

As Britons go the polls, they should challenge their candidates to justify what is being done in their name. A system of government that they have spent two centuries evolving and still not perfected is being rammed down the throats of poor and insecure people, who are then hectored for not handling it properly. Why should they? The invasions of their countries was not their choice. They did not ask to be a model for Britain's moral exhibitionism. They did not plead for their villages to be target practice for western special forces.

Karzai is told he will lose Nato protection if he continues to associate with drug dealers and warlords – many of whom appear to be his relatives. He knows – as we know – that this is bluff. There can be no counter-insurgency without a client regime. Obama and Brown need him as much as he needs them.

Amid this bluff the only certainty for Karzai is that, one day, Nato will get fed up and leave him to his fate, as it is now leaving Maliki in Baghdad. If he wants to live, he must make his peace with Afghans, not Americans, and that means on Afghan terms. Free and fair elections and a stop to corruption will have no part to play in that survival game. Democracy has been greatly oversold.