Today the Iraq war was declared over by Barack Obama. As his troops return home, Iraqis are marginally freer than in 2003, and considerably less secure. Two million remain abroad as refugees from seven years of anarchy, with another 2 million internally displaced. Ironically, almost all Iraqi Christians have had to flee. Under western rule, production of oil – Iraq's staple product – is still below its pre-invasion level, and homes enjoy fewer hours of electricity. This is dreadful.

Some 100,000 civilians are estimated to have lost their lives from occupation-related violence. The country has no stable government, minimal reconstruction, and daily deaths and kidnappings. Endemic corruption is fuelled by unaudited aid. Increasing Islamist rule leaves most women less, not more, liberated. All this is the result of a mind-boggling $751bn of US expenditure, surely the worst value for money in the history of modern diplomacy.

Most failed "liberal" interventions since the second world war at least started with good intentions. Vietnam was to defend a non-communist nation against Chinese expansionism. Lebanon was to protect a pluralist country from a grasping neighbour. Somalia was to repair a failed state.

In Iraq the casus belli was a lie, perpetrated by George Bush and his meek amanuensis, Tony Blair. Saddam Hussein was accused of association with 9/11, and of plotting further attacks with long-range weapons of "mass destruction". Since this was revealed as untrue, the fallback deployed by apologists for Bush and Blair is that Saddam was a bad man and so toppling him was good.

The proper way to assess any war is not some crude "before and after" statistic, but to conjecture the consequence of it not taking place. Anti-Iraq hysteria began in 1998 with Bill Clinton's Operation Desert Fox, a three-day bombing of Iraq's military and civilian infrastructure, to punish Saddam for inhibiting UN weapons inspectors. To most of the world, it was to deflect attention from Clinton's Lewinsky affair.

Most independent analysis believed that Iraq had ceased any serious nuclear ambitions at the end of the first Iraq war in 1991, a view confirmed by investigators since 2003. Even so, Desert Fox was claimed to have "successfully degraded Iraq's ability to manufacture and use weapons of mass destruction". Whether or not this was true, there was no evidence that such an ability had recovered by 2003. Among other things, the Iraq affair was an intelligence debacle.

Meanwhile, the west's sanctions made Iraq a siege economy, eradicating its middle class and elevating Saddam to sixth richest ruler in the world, though he faced regular plots against his person. Western hostility may have shored him up, but opposition would have eventually delivered a coup, from the army or Shia militants backed by Iran.

Even had that not happened soon, Iraq was a nasty but stable secular state that no longer posed a serious threat even to its neighbours. It was contained by a no-fly zone that had rendered the oppressed Kurds de facto autonomy. It was not appreciably worse than Assad's Ba'athist Syria, and its oil production and energy supplies were improving, not deteriorating as now.

The Chilcot inquiry has been swamped with stories of the American-British occupation on a par with William the Conqueror's "harrying of the north". That any 21st-century bureaucracy could behave with such cruel and bloodthirsty incompetence beggars belief. The truth is it was blinded by a conviction in its neo-imperial omnipotence. However much we delude ourselves, the west is still run by leaders, especially generals, drenched in the glory of past triumphs: leaders who refuse to believe that other nations have a right to order their own affairs. The awfulness of Iraq in 2003 was not so grotesque as to be our business – even had we been able to build the pro-western, pro-Israeli, secular, capitalist utopia of neocon fantasy.

Germany, France, Russia and Japan did not go near this war. They did not believe the lies about Saddam's armoury and did not see any duty to liberate the Iraqi people from oppression. In his other-worldly performance before Chilcot, Blair offered only a glazed belief that he was revelling as a latter-day Richard the Lionheart.

All wars wander from their plan, since all armies are good at landings but bad at breakouts, and dreadful at occupations – known to every military manual long before Iraq. The truth is that this was always to be a headline war, fuelled by a desire to see what Bush celebrated as "mission accomplished" just when a nervous Pentagon was murmuring: "We don't do nation-building." It was a political invasion, not to win a battle or occupy territory but to score a point against Islamist militancy. That it meant toppling one of Asia's few secular regimes was another of its hypocrisies.

The overriding lesson of Iraq comes from that dejected goddess, humility. The dropping of thousands of bombs, the loss of 4,000 western troops and the spending of almost a trillion dollars still cannot overcome the AK-47, the roadside explosive device, the suicide bomber, and an aversion to occupation. Nations with different cultures cannot be ruled by seven years of soldiering. Bush and Blair thought otherwise.

The Iraq war will be seen by history as a catastrophe that did more than anything else to alienate Atlantic powers from the rest of the world and disqualify them as global policemen. It was a wild overreaction by a paranoid, overmilitarised American state to a single spectacular, but inconsequential, act of terrorism on 9/11. As such it illustrated how little international relations have advanced since the shooting of Archduke Ferdinand in Sarajevo. Its exponents are still blinded by incident.

All the UN's pomp cannot stop such incidents running amok. The UN is powerless in the face of glory-seeking statesmen, goaded by military-industrial interests of unprecedented potency. We might think that after history's mightiest lesson book – the 20th century – the west would be proof against repeating such idiocy. Yet when challenged to show prudence and maturity in response to terror, it plays the terrorist's game. It exploits the politics of fear.

The west is leaving Iraq in a pool of blood, dust and dollars. It remains wedded to Iraq's twin sister in folly, Afghanistan.