The Supreme Court ruled on Friday that a 1977 law does not authorize the president to impose sweeping tariffs.