WASHINGTON—The Supreme Court ruled Tuesday that deported noncitizens who re-enter the U.S. illegally and claim asylum must remain in custody while their cases are processed.

Normally, noncitizens seeking asylum are entitled to bail hearings where they can seek release if an immigration judge finds they meet certain conditions. But “aliens who re-entered the country illegally after removal have demonstrated a willingness to violate the terms of a removal order,” Justice Samuel Alito wrote for the court.

“Congress had obvious reasons to treat these” individuals more sternly than other asylum applicants, Justice Alito wrote, joined by the court’s other conservatives, Chief Justice John Roberts and Justices Clarence Thomas, Neil Gorsuch, Brett Kavanaugh and Amy Coney Barrett.

Justice Stephen Breyer dissented, joined by his fellow liberals Justices Sonia Sotomayor and Elena Kagan. “Why would Congress want to deny a bond hearing to individuals who reasonably fear persecution or torture, and who, as a result, face proceedings that may last for many months or years,” he wrote, arguing that immigration law didn’t require so harsh a result.

The case, Johnson v. Guzman Chavez, involved a group of noncitizens who were deported after entering the U.S. unlawfully and then returned. “For example,” the noncitizens’ brief said, “following his removal to El Salvador, respondent [Wilber] Rodriguez Zometa was immediately threatened with death by the 18th Street Gang. Fearing for their safety, each of the respondents returned to the United States without authorization.”

Federal courts in Virginia found Mr. Rodriguez Zometa and the other noncitizens eligible to apply for bail; appellate courts nationwide were divided on the legal question.

As in many immigration cases, the court had to make sense of complicated provisions that point in different directions. When previously deported noncitizens return unlawfully to the U.S., their previous removal orders automatically are reinstated and cannot be challenged.

The Supreme Court found this effectively makes their cases “administratively final,” triggering another section that makes detention mandatory until the noncitizens are again deported, which is supposed to occur within 90 days.

Elsewhere, federal law authorizes noncitizens to ask immigration judges to freeze their deportation orders to specific countries where they are likely to be persecuted or tortured, known technically as “withholding of removal.”

Justice Alito wrote that even if an immigration judge were to freeze a deportation order, as a legal matter the noncitizen still has been ordered to leave the U.S. and therefore the mandatory detention rule remains in effect. Freezing deportation doesn’t grant a right to remain in the U.S., but rather prohibits removal to a specific country, he observed, and the government “retains the authority to remove the alien to any other country authorized by the statute” where conditions may be safer.

The dissent argued that the continuation of immigration court proceedings meant the deportation orders weren’t “administratively final,” and that as a practical matter, once withholding of removal is granted the noncitizen typically remains in the U.S.

“A bond hearing does not mean an alien will run away,” Justice Breyer wrote. “Bond is normally granted only if the immigration judge has assurance that the alien will not abscond and is instead ‘likely to appear for any future proceeding,’” he wrote.

Write to Jess Bravin at jess.bravin+1@wsj.com