The U.S. Supreme Court upheld a law banning TikTok over national security concerns unless it is sold by its Chinese owners.