Faced with the prospect of allowing more robocalls to mobile phones or fewer, the Supreme Court on Monday took what millions of Americans might say was the obvious choice.

“Americans passionately disagree about many things,” Justice Brett M. Kavanaugh wrote in the lead opinion for a splintered decision about the federal law regulating the issue. “But they are largely united in their disdain for robocalls. The federal government receives a staggering number of complaints about robocalls — 3.7 million complaints in 2019 alone.”

So after a majority of the court found what it said was an unconstitutional provision in the law banning such calls, a different majority said the solution was to eliminate the provision, not the law.

The bottom line of Barr v. American Association of Political Consultants: The consultants “still may not make political robocalls to cell phones.”

Also banned as a result of Monday’s decision are previously allowed automated calls made to collect debts owed to or guaranteed by the federal government, such as student loan and mortgage debts.

The case concerned the Telephone Consumer Protection Act of 1991, which generally prohibits robocalls to cellphones and home phones. (Although any phone owner would attest enforcement is spotty at best.)

Congress amended the law in 2015 regarding cellphones to allow for debt collection. And then political and nonprofit organizations sued, saying it was a First Amendment violation to allow the calls the government was interested in, but not their calls.

The court’s conservatives agreed. They said bans based on the content of a message must meet the highest scrutiny, meaning that it serves a compelling government interest and is as narrowly drawn as possible. Strict scrutiny almost always results in a finding that it is unconstitutional.

Under the 2015 exception to the law, Kavanaugh wrote, “A robocall that says, ‘Please pay your government debt’ is legal. A robocall that says, ‘Please donate to our political campaign’ is illegal. . . . Because the law favors speech made for collecting government debt over political and other speech, the law is a content-based restriction on speech.”

The court’s liberals disagreed that all content-based restrictions are subject to strict scrutiny and worried about the effect on government speech. Justice Stephen G. Breyer wrote that it is “important that courts not use the First Amendment in a way that would threaten the workings of ordinary regulatory programs.”

“Consider, for example, the regulation of securities sales, drug labeling, food labeling, false advertising, workplace safety warnings, automobile airbag instructions, consumer electronic labels, tax forms, debt collection, and so on,” Breyer wrote. “All of those regulations necessarily involve content-based speech.”

He was joined by Justices Ruth Bader Ginsburg and Elena Kagan. Justice Sonia Sotomayor said she agreed with most of that, but she felt the debt-collection provision failed even under less demanding standards.

“The Government has not explained how a debt-collection robocall about a government-backed debt is any less intrusive or could be any less harassing than a debt-collection robocall about a privately backed debt,” Sotomayor wrote.

The political consultants had argued that if the debt provision was unconstitutional, the entire ban on robocalls to cellphones must fall.

But seven members of the court said that was wrong. Breyer, Ginsburg, Kagan and Sotomayor joined Kavanaugh, Chief Justice John G. Roberts Jr. and Justice Samuel A. Alito Jr. in finding that the offending provision could simply be severed from the rest of the law.

It was the second time this term the court has found that a constitutional fault in a law did not mean it must fall in its entirety; the other involved the Consumer Financial Protection Bureau. Next term, the court will consider whether a court’s finding that part of the Affordable Care Act is unconstitutional means the entire law must fall.

Two justices — Clarence Thomas and Neil M. Gorsuch — would have found the debt provision was unconstitutional and that the proper remedy would be to allow political consultants and organizations to start making the calls.