What would make it illegal? Legislatures set their own internal policies and rules, and they all have procedures to expel or otherwise remove members they want to remove.
See also:
In theory she could sue them for being doodooheads.
Generally, courts are pretty deferential to the operating rules and procedures of a legislative body.