Yet it passed the House with an even greater margin — and even more Republican votes.

“Our people learned a lot of tough lessons in the last year, and I think you’re seeing the tough lessons applied,” said Representative Tom Cole, Republican of Oklahoma.

In the process, Speaker John A. Boehner has reasserted control over his fractious Republican conference, leaving his far-right flank angry and isolated. The speaker’s public and private denunciations of the outside conservative groups have created conditions in which members must choose sides, and they have.

“The Tea Party groups and conservative movement in America gave the speaker his speakership, and I think it’s time for us to be grateful for what these outside groups have done,” said Representative Raúl R. Labrador, Republican of Idaho, who has remained in the Tea Party camp.

But most have aligned with the speaker in what Republican leaders say is a growing realization that incremental moves toward governance are better than the purist, ideological stands demanded by the right.

“We can push large ideas out of the House and say, ‘This is what we feel is the right thing to do,’ but if we’re going to actually move things, they’re going to have to be smaller things,” said Representative James Lankford of Oklahoma, a member of the Republican leadership.

The Heritage Foundation drafted a lengthy to-do list for the huge spending bill, which included prohibiting funds to build a prison in the United States to house detainees from Guantánamo Bay, Cuba; eliminating all money for Vice President Joseph R. Biden Jr.’s cherished high-speed rail projects; cutting the operating budget of the Fish and Wildlife Service; providing money for private school vouchers for the District of Columbia; and significantly reducing the Internal Revenue Service’s budget, with language requiring more oversight of the potential targeting of political groups.

All of those requests — about half the to-do list, in all — were carried out, and yet Heritage Action demanded a “no” vote.