Jess Bravin and Eliza Collins | The Wall Street Journal

WASHINGTON—The House passed legislation that would expand security protection to the immediate family members of Supreme Court justices, sending the bill to President Biden’s desk for his signature.

The House took up the Senate-passed version after Republican Senate leaders warned Democrats that an attempt to broaden the bill to include families of court staff wouldn’t make it through the Senate.

The bill’s passage, 396-27, comes after an armed man, who officials said was upset over the court’s stance on abortions and guns, was arrested outside Justice Brett Kavanaugh’s Maryland home last week and charged with attempted murder.

The 27 “no” votes were Democrats from across the ideological spectrum. Some progressives said they voted against the bill because it wasn’t broad enough, and they felt Congress was neglecting its duty to protect healthcare workers who provide abortions or to put in place significant gun reforms to protect Americans.

“I don’t want us to send the message of saying it’s a big club and the American people aren’t in it,” said Rep. Alexandria Ocasio-Cortez (D., N.Y.).

Meanwhile, members of the New Jersey delegation opposed the bill because it didn’t include protections for federal judges and their families, which members of the delegation are pushing for after the son of a New Jersey federal judge was fatally shot in 2020, an aide said.

“We could not support passing legislation that continues to ignore the pleas of all federal judges for greater security,” said Rep. Josh Gottheimer (D., N.J.).

Sens. John Cornyn (R., Texas) and Chris Coons (D., Del.) proposed the original legislation, the Supreme Court Police Parity Act, after protests that followed a leaked draft ruling that indicated the court could overturn Roe v. Wade, the 1973 Supreme Court ruling establishing abortion rights.

Under current law, the Supreme Court Police have the authority to protect justices at all times and court employees while they perform official duties. The proposed legislation would extend protection to the justices’ immediate family members, in line with protections for some other government officials.

The legislation passed the Senate last month by unanimous consent, but had stalled in the House as Democrats worked to broaden the bill.

Republican Minority Leader Mitch McConnell (R., Ky.) said Monday an expanded version wouldn’t pass the Senate. Security should be “related to the Supreme Court, not the nameless staff that no one knows,” said Mr. McConnell. Mr. Cornyn echoed Mr. McConnell and said the threat to Mr. Kavanaugh underscored the importance of the Senate bill.

House Majority Leader Steny Hoyer (D., Md.) on Tuesday criticized Mr. McConnell and Mr. Cornyn for either “ignorance of the facts, or ignoring the facts” that Supreme Court clerks and their families had also been caught up in the dangers of being associated with the leak. He said it made sense to protect staff and their families because they were associated with the justices.

Still, he said, Democrats had decided to move forward without the language in order to protect the justices’ families.

Following the leaked draft, activists have shared home addresses of the justices online and encouraged protesters to demonstrate outside their homes. After the protests, including some at Justice Kavanaugh’s residence in Chevy Chase, Md., Attorney General Merrick Garland said the U.S. Marshals Service would provide round-the-clock security at the justices’ homes.

The Supreme Court is in the throes of an investigation ordered by Chief Justice John Roberts into the leak. Several law clerks have retained private counsel after investigators asked them to consent to searches of their cellphone records, people familiar with the matter said.

Rep. Greg Stanton (D., Ariz.), who sponsored the House bill to add protection for families of Supreme Court staff, said “some activists and news sites have ‘doxed’—or published the private information of—multiple clerks of the court, publicly accusing them without evidence of leaking to the press and putting their safety at risk.”

Mr. McConnell, in his comments on Monday, called House Democrats’ efforts to extend protections for staff an “unnecessary shot at sending a message about how proud they were that something leaked over at the Supreme Court.”

Urgency for the bill’s passage was heightened after police arrested an armed man outside Justice Kavanaugh’s suburban Maryland home after 1 a.m. on June 8. Nicholas John Roske, 26 years old, was found with a Glock 17 pistol, pepper spray, zip ties and other implements, the Justice Department said. Two deputy U.S. Marshals spotted Mr. Roske outside the Kavanaugh home, and he then walked away.

Mr. Roske texted his sister, who convinced him to call 911, Montgomery County Police Chief Marcus Jones said in a statement Tuesday.

“The suspect arrived by taxi and observed the U.S. Marshals outside of Justice Kavanaugh’s home. He then turned around to contemplate his next move,” Mr. Jones said. “This is when he texted his sister and told her of his intentions and she convinced him to call 911, which he did.”

Mr. Jones said county police officers responded immediately and located Mr. Roske, who complied with instructions and was taken into custody without incident.

According to an FBI agent’s affidavit, Mr. Roske said he intended to kill Justice Kavanaugh over the leaked draft opinion on abortion rights and concerns that Justice Kavanaugh could vote to loosen gun regulations in another pending case. He also told detectives that he was upset about the mass shooting at an elementary school in Uvalde, Texas. Mr. Roske was charged with attempted murder, the Justice Department said.

Mr. Roske, of Simi Valley, Calif., is being held at a state jail in Baltimore, according to a Maryland inmate database. One of Mr. Roske’s two court-appointed defense lawyers, Andrew Szekely, declined to comment on the case when reached by telephone last week.