The First Amendment of the US Constitution defines free speech as protection from government interference in free expression. Twitter is a corporation, free speech laws don’t apply. It can ban anyone it likes. This is perfectly legal.
But the term is being used in this context in a looser definition.