The legislation would have offered amnesty and a path to citizenship to an estimated 2.2 million direct beneficiaries. It would have eliminated certain categories of chain migration, but preserved the largest ones. It would have ended the visa lottery. Finally, it would have funded the border wall to the tune of $23 million (in theory, anyway).
President Trump, who had sagely advised his party not to waste time on immigration legislation given the absence of support by Democrats, came out in favor of the bill a few hours before the vote. It didn’t matter. Nearly half of the Republican caucus voted against the bill as, of course, did the Democrats.
Even if the House had passed the “compromise” bill, it would have been dead on arrival in the Senate due to the 60 vote requirement. That’s why Trump advised House Republicans not to waste time on the matter.
Given the futility of this legislative effort, I assume that House Republicans, other than those who are retiring, based their vote on their individual political interests. That, at any rate, is what I believe they should have done under the circumstances.