Recent attacks in Kabul confirm the occupation is falling to pieces. Claims about "decisive years" and "turned corners" are little more than cant. Instead for all their lack of air power, drones and high-tech equipment, the Taliban are gaining ascendancy.

The ability to attack up to seven different locations, to hold one for 20 hours, and to attack the fortified compounds of the occupiers and local supporters cannot sensibly be read as a sign that the insurgency is losing ground. Fighting in Afghanistan is seasonal and the Kabul attacks were the season's opening game.

No insurgency can survive without broad support from the local population. The insurgent relies upon the people for intelligence, support, safety and more. The fact that insurgents now control great swaths of the country virtually unchallenged tells us the people have been lost, partially due to the occupiers' bumbling efforts. The argument that Afghans are rejecting the Taliban falls flat.

Let's not forget there is no mandate in law for aggression nor any mention of – or authority for – brutally occupying Afghanistan in the UN resolutions regarding it. Which is why I refused to serve a second tour in Afghanistan. I was sentenced to five months in military prison for it but other soldiers too have refused and are refusing to serve in Afghanistan – as is their right.

The Daily Mail published an excellent article about an anonymous British major's despair at being deployed into what he – and many soldiers I know – consider a lost cause. They are increasingly unwilling, as the officer said, to die for "a war of choice already lost halfway across the world" For all the clarity of the article, it ends in jingoism: dutifully, he will fight on, the writer asserts.

Yet conscientious objection is a legal and contractual right. In fact, it is more than that – it is a legal and moral obligation. This is why we must not accept the debate about serving in Afghanistan to be to narrowed down to an exchange about a soldier's heroism or cowardice. Instead, I would encourage servicemen to explore their right to refuse, be aware of it and to act upon their conscience. You will find you are not obliged to go; contracts, remember, bind multiple parties, not just one.

Naturally, the military and government will make it hard. Their oft-repeated fear is that if refusing to serve is allowed, "the floodgates will open". They are correct and that is all the more reason to inform servicemen and servicewomen of their rights.

At the same time as the Taliban attacks there has been a rise in atrocities. We have recently seen British soldiers arrested on suspicion of abusing children, as well as the stabbing by a squaddie of a 10-year-old Afghan boy. A multinational operation in all respects, the US has done its share; kill teams, SS flag-waving, photographing bodies, urinating on corpses and the Panjwai massacre carried out, according to the witnesses, by 15 to 20 US troops. When young men are shaped for war and sent to fight there are consequences – even in "just" wars. The training involves two-way dehumanisation – both of our soldiers and of the enemy – as Giles Fraser highlighted lately. These acts are coming thick and fast at the end of a long, dehumanising, failed war. Conscientious objection was a hard road for me, but while I was in military prison I received 200 letters a day, which helped. As did the support of my fellow soldiers.

Those sending our young men and women to die or be mutilated for nothing have no authority to say what is honourable, courageous, heroic, or cowardly. You can volunteer, and you can un-volunteer. It's in the contract. Then perhaps our cynical, diamante-poppy-wearing political class will stop using the last dead kid to justify the next dead kid – insisting we must fight on so they have not died in vain. By refusing, I clawed back some honour from an honourless war.

• This article was amended on 25 April 2012. It originally referred to soldiers recently having been convicted for raping children. This was incorrect, but two soldiers have recently been arrested on suspicion of abusing children. This has now been corrected