tbh there is nothing ethical or legal about this, actually has to have legal consequences and maybe prison time.
Especially given that things like GDPR and and the CCPA are drawing clear boundaries around private data and how companies can use it, it shouldn't be impossible to make laws that regulate how third parties access and use that data.
I'd also hope that Twitter faces regulatory penalties and perhaps civil liability depending on the harm done.
This is no different than SSH into some machine and try password combinations, or try to login someones email with bruteforce.
Although rate limiting etc is necessary, I think brute forcing someones email account should be illegal.