The very fact that they had to pull the plug seems to suggest that it was not desired, and as such, it should have been safe guarded against.
An example safeguard being, limit what it can say. If it has racist/etc stuff in it, literally don't send to twitter. The bot still learns, the algos don't change, and Microsoft still gets to see what the given AI will behave like in full public. And above all else, the bot isn't a Microsoft branded Hail Hitler AI.
It sounds like you believe what happened is perfectly within reason - if that's the case, why do you believe they pulled the plug?
All in all, this is a lesson that some high-profile person/group eventually had to learn on our behalf. Now, when an unknowing manager asks why your chat bot needs to avoid certain offensive phrases because, "our clientele aren't a bunch of racists", you can just point him to this story. The actual racists are tame by comparison to what trolls will do to your software.
[0] = https://github.com/shutterstock/List-of-Dirty-Naughty-Obscen...