Musk's comments follow a ruling by the US Supreme Court, which unanimously upheld a federal law banning TikTok unless its China-based parent company sells the app.