When a politician chooses to create a social media page for purposes of their office, any moderation efforts and actions they partake are done as officers/representatives of the local/state/federal government. As such, they are not allowed to restrict the freedom of speech of individuals, because they are acting on behalf of the government, which would be in violation of the First Amendment.
It doesn't matter where this happens, only who is enacting the moderation.
This is why private companies can do so, because it's the private entity that is moderating content instead of an official of the government. A private company administering their own subreddit on Reddit, another private entity, could also moderate comments and content.