The high court reversed a decision by a U.S. appeals court that upheld the law .