The National Rifle Association once supported the expansion of background checks, but it decided this time that President Obama and gun-control advocates could not be allowed even a scintilla of a victory, no matter how sensible. That group, and others even more militant, wanted to make sure not one bill emerged from the Newtown shooting, and they got their way. A vast majority of Republicans meekly followed along, joined by a few nervous red-state Democrats, giving far more weight to a small, shrill and largely rural faction than to the country’s overwhelming need for safety and sanity.

Guns had not been on the president’s campaign agenda, but, to his credit, he and Vice President Joseph Biden Jr. came up with a solid package of proposals after Newtown that would have reduced the number of dangerous weapons on the street and in the hands of criminals. Mr. Obama traveled the country to promote it in 13 speeches, and he has spent the last weeks unsuccessfully trying to pry senators out of the pocket of the gun lobby.

The most important aspect of his proposal, in the eyes of many gun-control advocates, was the expansion of background checks, both because it closed an important loophole and because it seemed the easiest to pass. From 20 percent to 40 percent of all gun sales now take place without a background check, and the bill rejected on Wednesday would have required the check for buyers at gun shows, on the Internet and at other commercially advertised sales. It was sponsored by two pro-gun senators with the courage to buck the lobby, Joe Manchin III, a Democrat of West Virginia, and Patrick Toomey, a Republican of Pennsylvania.

The critical need for this measure was illustrated by a report in The Times on Wednesday that showed how easy it is for criminals to buy weapons on the Internet without a look at their backgrounds. One widely popular Web site contains tens of thousands of private postings of gun sales, and The Times’s investigation found that many buyers and sellers were criminals. Some of the guns have been used to kill.

A vote to continue this practice would be hard to explain to constituents, so lawmakers simply invented reasons to oppose background checks. Some insisted it would lead to a national gun registry, though the plain language of the bill prohibited that. Senator Tom Coburn of Oklahoma said it would raise taxes. Senator Jeff Flake of Arizona said it would require checks even when a gun sale is posted on an office bulletin board. (There’s nothing wrong with that, but it wouldn’t.) Mr. Obama, after the vote, said those who made these arguments had “willfully lied.”