It might be illegal because Twitter is essentially banning Republicans while not banning Democrats. During the middle of campaign season for the midterm elections. There are strict rules for media companies dealing with politicians and campaigns and possibly Twitter’s actions have broken those rules.