Milo wasn't harassing anybody, except by the broadest and most over-sensitive possible interpretation of the already diluted word 'harassment'. Milo himself never did anything to anybody other than toss out singular, one-off quips about people. But people like to hold those with many followers responsible for what their followers say. While it's emotionally tempting to do so, it's also stupid, unworkable, and ultimately always serves as the go-to excuse to ban someone with the wrong views.
It isn't hypocritical to choose who you want on your platform. Twitter has no obligation to be some neutral platform. They have never claimed this and have never tried to do this.
At Twitter's scale, they do have an obligation to be a neutral platform. They own the modern digital "town square". Things have changed since the old days.
Businesses have obligations beyond just barely staying within the law. Just because it's legal doesn't mean it's ethical.