WASHINGTON — The Supreme Court on Wednesday struck down a Tennessee law that barred newcomers to the state from operating liquor stores. The majority rejected the argument that the 21st Amendment, which ended Prohibition in 1933, allowed the state to restrict liquor sales in many ways, including by imposing a two-year residency requirement for people seeking retail liquor licenses.

Justice Samuel A. Alito Jr., writing for the majority in the 7-to-2 decision, said that the amendment did not authorize states to discriminate against new residents. “Because Tennessee’s two-year residency requirement for retail license applicants blatantly favors the state’s residents and has little relationship to public health and safety,” he wrote, “it is unconstitutional.”

In dissent, Justice Neil M. Gorsuch wrote that the majority was replacing the amendment’s requirements with its own ideas about sound economic regulation.

“Like it or not, those who adopted the 21st Amendment took the view that reasonable people can disagree about the costs and benefits of free trade in alcohol,” Justice Gorsuch wrote. “Under the terms of the compromise they hammered out, the regulation of alcohol wasn’t left to the imagination of a committee of nine sitting in Washington, D.C., but to the judgment of the people themselves and their local elected representatives.”