Withdrawal from Afghanistan would be at a far greater costs that the fiscal expenditure on kit (not to mention lives). The UK's remaining credibility within NATO - and our 'special' relationship with the US - would be irrevocably damaged. The UK's international standing (which is much higher than many posters here seem to think) would suffer - as we have shown weakness.
This is the nub of the problem. Credibility, standing and reputation have no easy fiscal value. Troops, tanks and planes do.
Until the beancounters can transpose the equation to make sense, we are going to keep getting shafted.
C'est le Guerre!