(CNN) -- The Senate voted Tuesday against taking up a measure that would have imposed a two-year ban on legislative earmarks, a practice that critics have called an example of wasteful spending.

Legislators voted 56 to 39 in favor of considering a ban, but the measure needed 67 votes to pass. The senators were actually voting on whether to end debate on another matter to consider the earmark ban, but its defeat signals that senators are apprehensive about approving a ban -- at least for now.

Supporters of the ban say many earmarks waste taxpayer dollars. They said they hoped a vote would build momentum for an eventual ban on earmarks, pet projects that legislators insert into bills, typically for spending in their state or district.

The moratorium would have barred any legislation that included a provision "included primarily at the request of a Senator or Member of the House of Representatives ... targeted to a specific State, locality or Congressional district" other than through procedures that typically involve more oversight.

Democratic Sen. Claire McCaskill of Missouri and Republican Sen. Tom Coburn of Oklahoma championed the effort for a two-year ban.

Senate Republicans have voted to forgo earmarks, but that ban is voluntary. The measure McCaskill and Coburn pushed would have made a ban enforceable.