It's not clear that the government is legally able to censor all types of spam. If the spam is commercial, the Central Hudson four-pronged test on commercial speech restrictions applies,[1] which requires, among other things, that the restrictions be "no more extensive than necessary to serve [the government's] interest". Non-commercial forms of spam would probably be protected from removal by the First Amendment, unless, perhaps, they overloaded the government's servers.
Trolling categorised as "obscene" would be removable, but otherwise may be protected by the First Amendment. Also, the fact that every content moderation decision may be subject to litigation would make it extremely difficult for the government to meaningfully moderate content.
Private platforms, not bound by the First Amendment, and allowed to moderate without assuming liability by Section 230, wouldn't suffer these problems
[1]: Via White Buffalo v. UT Austin