The surrender by Senate Democrats on the spending bill needed to avoid a government shutdown turned a defeat into a debacle.