Sometimes they have to lie. As the British death toll in Afghanistan rises past 400, every news item tells of reverses, mistakes and a desperation to withdraw. Someone has to hold the line. Those whose job is to fight and possibly die for their country need to believe they do so for a purpose. A nation bidding them to die needs it too.

Hence the prime minister has to assert the six-year attempt to cleanse Taliban from Helmand province as "vital to our national security", when everyone knows that this is absurd. The defence secretary, Philip Hammond, has to say: "We owe it to the all too many who have sacrificed their lives to see this mission successfully concluded." The chief of the defence staff, Sir David Richards, has to claim that "truly impressive" progress has been made, and "We will hold our nerve". The former head of the army, Sir Richard Dannatt, asserts that we have "exposed al-Qaida's cynical manipulation of Islam, and so made the UK and the west safer". The general on the ground, James Bucknall, says that "now is not the time to blink".

So far, so obligatory. But the impression is of a speak-your-war machine that has has lost any contact with reality. Preparing the nation for defeat may require the phoney oratory of national security. But when the trumpets and drums depart, the country is left with grim facts. Far more true was Thursday's remark of a service widow, Wendy Rayner, who protested that, after this is all over, "the poor people who are left will go back to the same crappy lifestyle that they had before our lot went in".

General Richards declares that the Afghanistan operations "did not start out of nothing, or from vainglorious adventure, they were triggered by a terrorist atrocity which still casts a shadow over our world" – a world united, he said, in the need to remove the perpetrators of 9/11 from their bolt hole in Afghanistan. Although they were only a "fringe movement", they were still a threat. The threat would continue, said the general, as long as Afghanistan lacked "institutions that ensure a country can govern and take responsibility for itself". Therefore British arms should create such institutions.

These assertions are empty of meaning, sent to smithereens by the blast of an exploding Warrior. They have been trotted out for a decade in Afghanistan, along with the usual drivel of corners being turned and lights at the end of tunnels. States hate other states bossing them about, and hate it more the longer the bossing continues, especially when done with the cruelty and incompetence on daily display in Afghanistan. They give support to anti-occupation insurgents, and resent being told by pompous generals that such support endangers the "national security" of distant peoples. The war the Taliban fighters are waging with vigour and success is to regain the integrity of Afghanistan, no more or less.

The postimperial claim that a Taliban Afghanistan poses an existential threat to Britain is so daft that only very intelligent men would dare try it on a public they regard as stupid. Osama bin Laden pulled off a coup on 9/11, but it never threatened any state as a nation. And if anyone or anything can take credit for it not being repeated, it is domestic security, not Nato's global reach. If anything, the much vaunted safety of Britain's streets has been diminished by Tony Blair's obsessive wars against Islamic states. Look round fortress London.

The reason British troops are still dying in Afghanistan is because a shocked Bush administration felt in 2001 that it had to fight someone to avenge the humiliation of 9/11. It did so not in a futile attempt to eradicate "bolt holes" (which can be anywhere) but as a retaliatory class action against a country too weak to fight back. It had all the subtlety of the Third Crusade. Rather than counsel restraint, Britain recklessly joined in, and an unemployed Nato did likewise. The price has been paid by the poorest people on earth, but even America can now ill afford the $100bn a year it is costing. Meanwhile, Afghanistan is most certainly fighting back.

There is no conceivable reason for Britain to remain in Afghanistan. The Afghan army and police are unable to assert Kabul's control over the country, and thus offer any reassurance that there will be no bolt holes. Pakistan is blatantly pursuing its own Afghan agenda, now in alliance with the Taliban. Their reported dominance over more and more provinces is a wretched comment on 10 years of campaigning by the world's most sophisticated military powers. Even in the capital, Kabul, foreigners can no longer roam free outside their fortified enclaves.

Britain desperately needs to engineer a dignified retreat. It does not own Afghanistan, and Afghanistan is not its business. The ambition to bring Afghanistan democracy, security and gender awareness was unjustified and has failed. Its internal government is for Afghans (and their neighbours) to ordain, and is not a feasible task for British soldiers and taxpayers.

Even now, British strategy is puzzling. Aid is being poured into the country, much of it stolen, wasted or departing in suitcases on the next plane to Dubai. Both Britain and America have signalled their exit by 2014, leaving Afghans to make peace with whomever they regard as the enemy. Meanwhile, American marines are planning to leave Helmand this summer, which puts British soldiers back in an exposed position, mentoring an unreliable Kabul army to keep Pashtun fighters at bay. The prospect is of a retreat as depressing as from Basra in 2007, with local troops expected to continue a civil war that Nato began. Everyone knows the Taliban will just take over.

The one hope now is that those in authority and with influence over authority (which includes the media) might stop lying. The language of reassurance may be needed by troops at the front, given the obscenity of their continuing to die for a pointless cause. Greater assurance would come from knowing that such language does not privately deceive those using it in public, those responsible for this defeat. When, as must be the case, there is a Chilcot-style inquiry into the Afghan fiasco, leaders of Labour and Conservative governments have serious explaining to do. They must explain not just what they did but what they said they were doing, and why.

• Follow Comment is free on Twitter @commentisfree