The decision, in which South Dakota prevailed over the online furniture retailer Wayfair, immediately sent ripples through the internet shopping industry sending shares tumbling in Amazon, eBay, Etsy and others.
The court's nine justices split five to four in overturning a prior Supreme Court decision that had held that a state can only tax sales by businesses that are physically present in that state.
South Dakota's case was supported by 35 states and the federal government and saw the Supreme Court undo a 1992 ruling in which it had held that the mail-order company Quill did not have to collect sales taxes in North Dakota.
The court held that its prior "physical presence rule" was "unsound and incorrect" and so prior decisions from 1967 and 1992 were both overruled.
State coffers, many of which are struggling with deficits, stand to gain billions.
Shopping centers, department stores and major retail outlets have laid off thousands of workers and are struggling to remain open as consumers turn to internet home delivery for an ever-increasing array of goods and services.
In a concurring opinion, Justice Clarence Thomas said that after ruling for the retailer in 1992, he had changed his mind.
A "quarter century of experience has convinced me" the Supreme Court's earlier decision was no longer justified, he wrote, adding that it was "never too late" to arrive at a better position.