They really can't, unless it was some State approve doctrine.
In other words, a private person or private company (such as a social media company) cannot violate your constitutional free speech rights, only the government can do so. That is, unless the private party attempting to restrict speech qualifies for one of the three exceptions to the State Action Doctrine.
And twitter is located in CA so it is part of US. Not some foreign country that can censor whatever they want.
Also source in regards to companys and free speech.
https://accessiblelaw.untdallas.edu/limits-free-speech-social-media#:~:text=In%20other%20words%2C%20a%20private,to%20the%20State%20Action%20Doctrine.