Then the assholes shouldn't have said anything in the first place. We're not talking about a couple of screwed up kids thinking that they're funny. The people doing this were adults. There is no fucking excuse for this.
Like many others in this discussion you've reduced it to a black and white situation: they did something wrong, therefore they deserve everything that might possibly come in terms of consequences. That's an extraordinarily harsh attitude to take to mistakes made by teenagers.
If someone came onto your lawn and started yelling about how they were going to rape your daughter, they're not going to get a little slap on the wrist. They'd get arrested, thrown in jail, and possibly be put on a sex offender list.
This example supports my point: the justice system deals with this sort of thing in right way, with a measured, proportionate, just response. Sex offender lists do amount to public shaming (and they are somewhat controversial for that reason) but even you are not sure that would be appropriate in the above scenario. Yet that's exactly what you're advocating in online cases. Also note that if they are on your lawn the threat is rather more immediate and credible than bullying online. That makes a difference. Finally, I suspect you've overestimated what the justice system's response to a single incident of that nature would be.
In the general case, the problem with your position is that it assumes that this sort of response is always justified and correct. But at best this is mob justice and the mob will get it wrong at times. The Justine Sacco case is a good example. She made a joke that was misinterpreted. The consequences far outweighed the "crime".