That is true, but sanction in the court of public opinion isn’t the same as sanction in a real court. I’m not sure a judge should be taking bad publicity into account when handing out punishment - they should likely be treated as independent.
I think the sanction in the court of public opinion is probably much worse.
The Court of Public Opinion can't suspend or take away your law license.
If someone wasn't a lawyer and did something similar, they would face little to no negative effects socially. Why should a lawyer get a free pass, especially considering they should know better?