The court held that the risk to national security posed by the app's ties to China overcomes concerns about limiting speech.