WASHINGTON — With scorn bordering on anger, some of the Supreme Court’s more conservative members on Wednesday gave a hostile reception to a government program dating to the Great Depression meant to increase raisin prices by keeping some raisins off the market.

“Central planning was thought to work very well in 1937,” Justice Antonin Scalia said, “and Russia tried it for a long time.”

Chief Justice John G. Roberts Jr. said the program was “a historical quirk” that allowed the government to do more than regulate production. “You come up with the truck and you get the shovels and you take their raisins, probably in the dark of night,” the chief justice told a lawyer for the federal government, Edwin S. Kneedler.

Justice Samuel A. Alito Jr. likened the program to forcing cellphone makers to give every fifth phone to the government.

The case, Horne v. Department of Agriculture, No. 14-275, arose from the activities of Marvin D. and Laura Horne, raisin farmers in Fresno, Calif., who in 2002 set up a business arrangement that they claimed allowed them to avoid the program.

The Agriculture Department imposed fines, and the Hornes defended themselves on the ground that aspects of the program violated the takings clause of the Fifth Amendment, which says private property may not be taken for public use without just compensation.

The Hornes’ lawyer, Michael W. McConnell, said the program was distinctive because it required “an actual transfer of the raisins themselves.” Government regulations limiting how much farmers may produce present different questions, he said.

The court’s more liberal members did not sound enthusiastic about the program, but they may not have been convinced that it ran afoul of the Constitution.

Justice Elena Kagan told Mr. Kneedler that the program, which she called “a weird historical anomaly,” could be both ridiculous and lawful. When the justices heard an earlier appeal in the case in 2013, she said the court’s task was to “go and try to figure out whether this marketing order is a taking or it’s just the world’s most outdated law.”

On Wednesday, Justice Scalia told Mr. Kneedler that the nature of the program must count for something. “It doesn’t help your case that it’s ridiculous,” Justice Scalia said.

Justice Stephen G. Breyer seemed prepared to accept that the program was a taking. But he said the Hornes may nonetheless have no claim because the program left them better off.

“Yeah, it’s a taking,” Justice Breyer said. “O.K. But the Constitution forbids takings without compensation. The object of the program is, at least in general, to give farmers more compensation than they would have without it. Programs can work badly, sometimes they’re counterproductive, but if this is working well, that’s what happens.”

Mr. McConnell responded that oysters are wild animals that at least initially belonged to the state, which could therefore regulate them as it wished. “Raisins are not wild animals,” he said, “even if they’re dancing.”

Chief Justice Roberts was particularly critical of a passage in the government’s brief, which said that raisin farmers dissatisfied with the marketing program remained free to plant different crops.

He suggested an analogy. “Were going to say the Pledge of Allegiance in public schools, and we’re going to make everybody stand,” he said. “And if you don’t like it, go to a different school. I don’t understand why that’s not the same analysis here.”

There was much discussion of how broad the impact of a ruling striking down the program would be. Mr. McConnell said “hundreds of small California raisin farmers will be profoundly affected.” Mr. Kneedler said there were “eight or 10” similar agricultural programs, though most of them were inactive.

As the argument was ending, Chief Justice Roberts asked Mr. McConnell an unusual question, one unrelated to the issues before the court. “This is probably neither here nor there, but what has the impact of the drought been on the raisin producers?” the chief justice asked. “Do you know?”

Mr. McConnell paused before answering. “It is,” he said, “not good.”

A version of this article appears in print on , on Page B7 of the New York edition with the headline: Skepticism From Court on U.S. Raisin Program. Order Reprints | Today’s Paper | Subscribe

The All-New DealBook

Our columnist Andrew Ross Sorkin and his Times colleagues help you make sense of major business and policy headlines — and the power-brokers who shape them.

Please verify you’re not a robot by clicking the box.

Invalid email address. Please re-enter.

You must select a newsletter to subscribe to.

* Required field

You agree to receive occasional updates and special offers for The New York Times products and services.