It's not quite correct to say that the Supreme Court ruled that the ban is legitimate. It narrowly ruled that the immediate first amendment challenge wasn't sufficient to invalidate the law under intermediate scrutiny. The only thing they were evaluating was whether the impact of the ban was biased toward any particular content, which it isn't.
They didn't rule on the overall constitutionality of the act, whether its first section amounts to a bill of attainder, whether the forced divestiture would amount to a fifth amendment taking, whether it violated the broader freedom of the press under the first amendment, or anything else. Those questions might well be evaluated later.