Most Democrats and a handful of Republicans combined to defeat the effort, which would have effectively forbidden the Senate from considering legislation containing earmarks like road and bridge projects, community development funding, grants to local police departments and special-interest tax breaks.
The 39-65 tally, however, was a better showing for earmark opponents, who lost a 29-71 vote earlier this year. Any votes next year should be closer because a band of anti-earmark Republicans is joining the Senate.
Earlier this month, Republicans bowed to tea party activists and passed a party resolution declaring GOP senators would give up earmarks. House Republicans have also given up the practice, but most Democrats say earmarks are a legitimate way to direct taxpayer money to their constituents.
Sen. Dick Durbin, D-Ill., said Tuesday that Democrats had made the earmarking process far more transparent than it previously had been under GOP control of Congress. The reforms include requiring lawmakers to document every projects they seek and receive.
Seven Democrats voted with all but eight Republicans to ban the practice.
"I believe I have an important responsibility to the state of Illinois and the people I represent to direct federal dollars into projects critically important for our state and its future," Durbin said.
Critics say that peppering most spending bills with hundreds or even thousands of earmark projects creates a go-along-get-along mindset that ensures that Washington spending goes unchecked.
President Obama supports a ban as well, but hasn't fought them in the past two years.