"We hope that the Congress will ... not waste its time with ineffectual, sham legislation," White House press secretary Jay Carney said.
But the effort - along with a vote on a measure to expand offshore drilling that was also rejected - was designed to highlight differences between the two parties and provide campaign fodder in this year's battle to control the White House and the Senate.
"The president simply can't claim to have a comprehensive approach to energy, because he doesn't," said Senate Republican Leader Mitch McConnell of Kentucky. "And any time he says he does, the American people should remember one word: Keystone." No Republicans opposed the Keystone measure, but two did not vote.
Republicans are eager to showcase Obama's decision to withhold approval of the Canada-to-Gulf Coast pipeline as proof that the administration is not doing enough to generate jobs and increase energy supplies. But opponents of the project say supporters exaggerate the number of jobs it would create and dispute that it would bring down gas prices.
The pipeline issue has divided core Democratic constituencies. Some labor unions back the project as a way to create jobs; environmentalists warn the pipeline would expand the nation's carbon footprint and create more pollution.
An alternative Democratic measure that would, among other things, have prohibited the export of oil transported in the pipeline and, according to its sponsor, Sen. Ron Wyden (D., Ore.), put "teeth behind all of the debate that this energy is going to be for the America consumer," also failed.
Sen. John Hoeven (R., N.D.), who led the floor debate on the Keystone amendment, argued that the Democratic alternative measure would have added "additional impediments" to the project.
The Keystone votes come as the Senate is on track to pass a $109 billion, two-year transportation bill next week. The legislation sets road, highway, and transit priorities.
But the transportation bill's fate is uncertain because House Speaker John A. Boehner (R., Ohio) has been unable to corral a majority for passage in the Republican-controlled House. Republicans disagree on how big the bill should be and what it should include.
One measure passed Thursday would steer 80 percent of the penalties paid by BP for the 2010 Gulf of Mexico spill to restoring coastal ecosystems and rebuilding local economies in the gulf.