The problem is that there are nasty people, and the internet seems to allow them to be even nastier with impunity. And even people we might think of as nice can turn nasty, and say things they never would dream of saying in public. Because, after all, it's virtual, so nothing on this matters. But of course, it does, and the internet is for some people as much a part of real life as anything else.
There's little that can be done, other than trying to encourage people to be nicer, and to encourage those who might be victims to seek out help. But the trolling itself will never stop, at least in part people people want the internet to be open and largely free of censorship. For all the benefits that freedom brings, it will also bring these horrible stories. Thankfully, such stories are relatively where and overwhelmingly the internet has brought benefits, for example by allowing people to meet so much more of the world than ever they could have otherwise.