Private companies can do what they want, it's their platform and they can discriminate as they wish about what content they want to allow. You or me as a user have no right to publish through their platforms, we are just allowed to.
This is not illegal whatsoever, they own the platform, not you. It's of course unpopular for those affected by deletion, but they have every right to administrate the platforms they own as they desire.
If you want more legal protection against censorship you'll need to host your own website/platform, where you have the right to decide the content.
Should it be illegal? I say not because of the implications of it. Say you own a platform, you are legally obligated to allow others to post whatever they want and it's illegal for you to violate their right to have their opinion on YOUR website. That's kinda fvcked up, wouldn't you agree?