House Republicans and 42 Democrats joined forces Thursday to pass an amendment to the Rights for Transportation Security Officers Act that would keep people convicted of sexual assault, terrorism and other violent crimes from working for the Transportation Security Agency (TSA).

But 174 House Democrats — including House Majority Leader Steny Hoyer — did not support the legislation.

The vast majority of Democrats voted against the amendment, which was authored by Democratic Illinois Rep. Lauren Underwood.

Republican House Leader Kevin McCarthy was quick to criticize the Democratic leadership for rejecting the law. (RELATED: Report: Bill Clinton Says Cheating On Hillary Helped ‘Manage My Anxieties’)

“[The amendment] was pulled back by leadership because the socialist wing of the party did not want to have that amendment go forward on this bill,” the California representative said Thursday, according to the Washington Free Beacon. “When it was offered, overwhelmingly the majority of the House would like to see the TSA not hire terrorists or those who have been convicted of sexual misconduct with minors and others. But the socialist wing of the party, that controls now the Democratic Party, said that that could not be offered.”

Every member of the “squad” voted against the amendment. House Speaker Nancy Pelosi did not cast a vote.

A top Republican aide suggested it was just more of the same Democratic hypocrisy that protected sex offenders from justice.

“It’s no surprise that Democrat logic in 2020 means taking marching orders from Justice Democrats to give TSA the ability to hire the Harvey Weinsteins of the world,” the aide told the Free Beacon. “A ‘second chance’ for sex offenders shouldn’t include patting down traveling families.” (RELATED: Hillary Clinton: Weinstein ‘Contributed To Every Democrat’s Campaign)

Critics have also faulted TSA for being lax when it comes to identifying people on the terror watch list. TSA agents were charged with trying to smuggle 20 tons of cocaine from Puerto Rico.

Republican Arizona Rep. Debbie Lesko said the legislation was necessary given some of the behavior of TSA screeners, one of whom used his position to order a woman to disrobe while she went through security.

“Fortunately, this offender was immediately fired by the TSA. However, under this bill … this predator could be on the federal payroll for months or even years,” Lesko said, according to the Free Beacon. “We have two options today: Adopt the Underwood amendment and keep sexual predators off of the federal payroll, or reject it and reward sexual predators with a paycheck from the taxpayer.”

The Rights for Transportation Security Officers Act passed the House with a vote of 230-171. It aims to put TSA employees on par with other federal government employees by offering access to collective bargaining in contract negotiations and protection of whistleblowers, The Hill noted.

TSA workers are usually paid less than most other government employees.