Paying for the wars in Iraq and Afghanistan in fits and starts undermines US military planning and risks the gains made by US troops.