It's perfectly legal under the current rules as they apply to Twitter (in the United States) but one has to wonder (now and before) if it is advisable to keep them as such.
That is the public discussion societies around the world will have.
Elon Musk highlighted this issue by falsely and strongly claiming impartiality
And I think this also shows why corporate capitalism is inherently at odds with democracy: every corporation is effectively a dictatorship, their internal economy a plan economy, its rules at the whim of the CEO. And Elon is more eager than many CEOs to abuse this power. I wonder if it's going to lead to a revolution against corporations similar to the revolutions we got against monarchs.