That's what McCain said at the debate, but he didn't articulate his meaning well at all. Let me give it a shot. Let's say Congressman X is an idealistic young Congressman. Some constituents in his rural district ask him to get federal funding for a new emergency room in a local hospital, because the nearest emergency room is 100 miles away. Congressman X is skeptical of earmarks, but this particular one both seems like a good idea and a way to help ensure his reelection--he won his first term with only 52% of the vote. He manages to slip the hospital funding into an appropriations bill.
Soon thereafter, Congressman X becomes aware of a new $5 billion initiative that is a complete and utter boondoggle, but will benefit the districts of several influential congressmen. He starts sending out press releases opposing the initiative, and threatens to a force a vote on an amendment removing the initiative from the bill to which it is attached.
The senior Congressmen who support the initiative schedule a meeting with Congressman X. Like mafia thugs, they tell the Congressman, "It would be a real shame if anything was to happen to your hospital funding--and any future funding for your district, for that matter." The message is clear; if Congressman X wants any hope of bringing federal money into his district, he had better stop opposing wasteful spending supported by his colleagues. He drops his opposition to the $5 billion project, gets the hospital funding, is reelected easily, and never again shows any "spending hawk" tendencies. Soon, in fact, he is rather senior himself, and finds himself meeting with a junior Congressman, telling him "It would be a real shame if anything was to happen to your hospital funding--and any future funding for your district, for that matter."
So, even though earmarks are a small percentage of the federal budget, they are a very important part of a broader system of corruption that leads to out-of-control federal spending.