I'm not defending any potential actions he took, but:
There are laws about sexting minors, so if he had done that then he would have broken it and they would have plenty of evidence of that.
If nobody above 18 is morally justified to be in a chat with anybody under 18 then we've got some serious societal level issues to fix.
EDIT: And btw they tried to get out of paying him 20M, but realized they had no grounds to do so when he started his lawsuit. They had incentive, here. They wanted to not pay him.
It doesn't seem like such a large gap or grey area to me. You can tell a woman "Nice T-Shirt" and that is fine but "Nice Tits" is not fine, it's a pretty clear division to me. What could the Doc say that would qualify him as the monster people are calling him but also not illegal?
They attempted to not pay out his contract btw. He had to sue them to get that, and they payed it out. If they had evidence of such behavior from him then I'm sure courts would agree that his own actions destroying his own public image would have been more than enough reason to cancel the contract.