Another day, another attack. On Friday, the Taliban celebrated Afghanistan's independence day with an audacious assault on the British Council office in Kabul, which killed nine people. The day before, insurgents killed at least 25 people after a roadside bomb ripped through a minibus in the western province of Herat and a suicide car bomb exploded at a US-run base in the eastern province of Paktia.

Earlier in the week, on Monday, insurgents in Iraq launched their most deadly attacks of the year. At least 70 people were killed and more than 300 wounded in a series of co-ordinated strikes across the country, involving car bombs, gunmen and suicide attacks.

A decade on from 9/11, bloodshed and chaos continue to plague Afghanistan and Iraq. A US state department report published on Thursday revealed that the number of terrorist attacks in Afghanistan had jumped by 55% last year; in Iraq, attacks were up 9%. The US-led invasions and occupations of both countries have been a dismal failure – thousands of lives lost and trillions of dollars squandered. The presence of western troops in Muslim lands has provoked more terrorism than it has prevented.

In his book, Dying to Win: The Strategic Logic of Suicide Terrorism, the US political scientist Robert Pape analysed every known case of suicide terrorism between 1980 and 2005 – 315 attacks in total – and concluded that the "specific secular and strategic goal" of suicide terrorists was to end foreign military occupations. "The tap root of suicide terrorism is nationalism," he wrote; it is "an extreme strategy for national liberation".

Why does an intelligent politician such as Barack Obama have such difficulty understanding this? The US president has much to answer for. Yes, he inherited two bloody and costly wars from his predecessor. Yet, in Afghanistan, against the advice of his vice-president and his ambassador in Kabul, he escalated the conflict by sending an additional 30,000 young Americans to kill, and be killed by, the Taliban.

Putting more boots on the ground was a gross misjudgment. More US troops have died fighting in Afghanistan during Obama's two and a half years in the White House than in Bush's two terms in office – and, despite the recent decision to start bringing troops home, there will be more US military personnel fighting the Taliban at the end of Obama's first term in office than at the start.

Iraq, meanwhile, has become the forgotten war – yet an astonishing 47,000 US troops remain stationed there. Earlier this month, Obama told a group of supporters: "If somebody asks about the war [in Iraq] … you have a pretty simple answer, which is all our folks are going to be out of there by the end of the year."

Not quite. US military leaders expect to keep up to 10,000 "folks" in Iraq beyond the 31 December 2011 deadline, agreed by the Bush administration, for a full US withdrawal. Obama's hawkish new defence secretary, Leon Panetta, used his Senate confirmation hearings in June to announce that he had "every confidence" that the Iraqi government would "request" US troops to stay on in the country beyond the end of the year. However the anti-US Iraqi cleric Moqtada al-Sadr declared this month that any foreign soldier remaining in Iraq in 2012 would "be treated as an unjust invader and should be opposed with military resistance". So we can expect further bloodshed in that benighted nation: America's Mesopotamian misadventure is far from over.

It was the historian Charles Beard, writing in 1947, who described the national security doctrine of US presidents as "perpetual war for perpetual peace". His Nobel peace prize notwithstanding, Obama has proved to be no different to the rest.