I think Google legally had a mechanism to do this, but ethically is messed up big time. The saying was "don't be evil", not "don't be criminal". I don't know if Google leadership was evil but the underlying principle is that "don't be illegal" is a low bar. I expect everyone to strive to do much better than that.
I don't see a lot of calls in these comment threads for an employee bill of rights or something, so I don't know why this keeps coming up.