The Supreme Court has a lot of things they can do in theory, but in reality, there are only two options the Court likely considered:
One was to simply dismiss the writ of certiorari as improvidently granted due to neither party being significantly affected by the outcome of the case, as they did in Public Employees’ Retirement System of Mississippi v. IndyMac MBS.
The second was to vacate the lower court ruling and remand with instructions to the lower court to dismiss the case. That is what they did in this case.
Why not leave the appeals court's ruling on the record, because it is always possible a future president will try to block users while communicating with a personal social media account? Now if the issue pops up again in the future, a president will wrongly be allowed to block users for multiple years while the issue gets re-litigated from scratch.
That was their other option. The most obvious explanation for why they didn't pick that option is that the Supreme Court explicitly wanted this result, likely because at least some of them don't agree with your characterization that they would "wrongly be allowed".
I suspect what's going on here is that there is nobody to challenge this ruling in an adversarial situation. So the Supreme Court doesn't want a piece of precedent that resulted only from the administration being changed and would prefer that if there's going to a precedent-setting case on this, that it be aggressively litigated.
So essentially, they didn't want this on the books because it wouldn't get appealed and they weren't convinced it was decided correctly.