The U.S. Supreme Court has ruled that online retailers must collect sales tax from customers even in states where they don’t have a physical presence, effectively closing a loophole that has long been seen as a major disadvantage to brick-and-mortar retailers.