“the more an owner, for his advantage, opens up his property for use by the public in general, the more do his rights become circumscribed by the statutory and constitutional rights of those who use it.” (Marsh v. Alabama, 326 U.S. 501, 506 (1946)
They have since narrowed their interpretation somewhat, but some states (including California) have ruled that de-facto public gathering places such as shopping malls are areas where free speech is protected, even though they are privately owned.
So generally, yes a private platform can do what they want, but if their primary focus is to be open to the public, they may be more bound to providing first amendment protections.
AFAIK no court has specifically ruled on whether online public spaces should be treated the same as physical public spaces.