“The toughest thing to do in politics is to do the right thing when your supporters think the right thing is something else,” Toomey said.

In remarks Tuesday at the White House, Obama said he too believed that Republican lawmakers were reluctant to support legislation that he openly advocated for.

"They're worried about their politics. It’s tough. Their base thinks that compromise with me is somehow a betrayal. They’re worried about primaries. And I understand all that," Obama said.

Last week, Toomey had suggested the bill — which fell five votes short of the 60 needed to pass the Senate — had failed because the president ran a "divisive" reelection campaign.

"I would suggest the administration brought this on themselves. I think the president ran his re-election campaign in a divisive way. He divided Americans. He was using resentment of some Americans toward others to generate support for himself. That was very divisive, that has consequences, that lingers," Toomey told The Morning Call of Allentown, Pa.