Two years on from the suicide bombings that devastated London's streets and tube system, official Britain is still in the deepest denial about why this country is a target for al-Qaida- style terror attacks. In the wake of the abortive atrocities in London and Glasgow, there has been no shortage of lurid media coverage of the "doctors' plot" that came so close to carnage, nor of bombastic calls for the nation to stand firm against terrorists. The Sun was yesterday handing out free union jacks to "fly in the face of terror", while its heavyweight counterparts have been demanding ever greater efforts by an increasingly intimidated Muslim community to demonstrate its loyalty. Mercifully, the tone adopted by Gordon Brown has been less strident than his predecessor's - he has avoided the rhetoric of the war on terror and the shopping lists of new coercive powers favoured by Tony Blair in the aftermath of the July 2005 attacks and last year's alleged transatlantic airline plot.

But when it comes to the substance, there has been little change. The failed bombings were, Brown insisted, an attack on "our British way of life" and the "values that we represent", "unrelated" to the wars in Iraq or Afghanistan or any other conflict. He compared the fight against the bombers' ideology with the struggle against communism and called for a similar "propaganda effort" to win "hearts and minds". In the days since, this "it's nothing to do with the war" refrain has since been taken up with gusto by large parts of the media. The pro-war Times and Telegraph have led the field, with neoconservative commentators and politicians hammering home the Blair-Bush message that terror is simply the product of an evil ideology. Anyone who dissents or suggests a connection with Britain's violent role in the Muslim world is portrayed as somehow soft on terrorism - as the Liberal Democrats' Nick Clegg found when he tentatively referred to Muslim grievances in the House of Commons earlier this week.

In an echo of Gordon Brown's cold war propaganda theme, defectors from radical Islamist groups have been playing a prominent role in this campaign. Rarely a TV debate goes by without Ed Husain, one-time member of Hizb ut-Tahrir and now a British neocon pinup boy, or Hassan Butt, formerly of the banned al-Muhajiroun group, insisting that this is all about people with identity crises who are "hell-bent on destroying the west", denouncing Ken Livingstone for engaging in dialogue with Islamists, or calling for a harsher crackdown on their former fellow enthusiasts for the restoration of the caliphate. They are championed by politicians like the Tory Michael Gove and New Labour's Denis MacShane, who this week argued that all Islamists, from the liberal Muslim academic Tariq Ramadan to al-Qaida terrorists, had to be confronted without exception. It's become eerily reminiscent of the McCarthyite era when communist renegades would be wheeled out to give Americans a state-orchestrated glimpse of the enemy's dark heart.

Of course, it's perfectly true that al-Qaida and its "takfiri" fellow travellers have an extreme, violently sectarian and socially conservative ideology. But it is simply delusional - and flies in the face of logic and history - to fail to recognise the central link between the terror threat and Britain's post-9/11 actions in the Muslim world.

First, there were no al-Qaida-inspired attacks in Britain before the invasions of Afghanistan and Iraq. There were against the US - starting with the World Trade Centre in 1993 - triggered by the aftermath of the Gulf war, as well as jihadist campaigns in Kashmir, Chechnya and Bosnia. But Britain was not a target until it attacked the Muslim world. If the bombers' real focus was, say, sexually liberal western lifestyles, they would presumably be attacking cities like Amsterdam and Stockholm.

Second, it is only necessary to listen to what the bombers say themselves. Just as Bin Laden has repeatedly spelled out that his campaign is about western occupation of Muslim lands and support for pro-western autocracies, so the "martyrdom videos" made by the London bombers of 2005 made clear that they regarded their attacks as revenge for British support for Israel and the occupations of Afghanistan and Iraq: "Until you stop the bombing, gassing, imprisonment and torture of my people we will not stop this fight," Mohammed Sidique Khan declared. The government was repeatedly warned before the Iraq war that it would bring terror to Britain, and a string of government, intelligence and other reports have since underlined the connection - also accepted by a large majority in opinion polls.

In the case of these latest bungled bombings, in which two Iraqis, a Palestinian and at least two other Arabs are said to have been involved, it's not hard to guess what might lie behind them. And while politicians who have supported wars that have cost hundreds of thousands of lives might want to cast a veil over the link, it makes no sense for the rest of us.

The neocon attempt to lump together all Islamists - a political trend that stretches from Turkey's ruling Justice and Development party to al-Qaida - as beyond the political pale will meanwhile only make it harder to overcome the terror threat and isolate those who believe it is justifiable to kill civilians in retaliation for the Iraqi and Afghan bloodbaths. It is a folly that exasperates senior figures in the police, including special branch, whose job is to counter terror groups in the Muslim community. Just as mainstream Islamists in the Palestinian territories such as Hamas have helped prevent the encroachment of takfiri jihadists, so non-violent Islamists in the west can offer an alternative political channel to those who might otherwise be drawn to al-Qaida-inspired terror. "This approach has played into the hands of al-Qaida," one high level special branch officer argues. "Islamists have the best antidotes to al-Qaida propaganda."

Given Britain's role in the Muslim world, the surprise must be that there haven't been more attacks. They have, after all, yet to reach anything like the level of the campaign waged by the IRA. But that such attacks continue is a central part of Blair's legacy - and the responsibility of a political class that failed to hold to account those who launched an illegal war of aggression with the most devastating human and political consequences. Until the Brown government makes serious moves to end Britain's role in the occupations of Iraq and Afghanistan, the likelihood must be that the threat will grow.