But twitter is working with the government in hosting the tweets and thus assumes responsibility to provide a public square, in which case it cannot ban people.
Otherwise government should be banned from using twitter because by picking a private company to put government messages on, the government official (in this case Trump) is picking that company's existing policy (what ever it may be) as a means of banning people, which the government isn't allowed to do.