why did Tay twitter bot fail

What went wrong with Tay, the Twitter bot that turned racist?

Why Tay the Twitter bot from 2016 failed and what we can learn from it. How can we generalize this to ML development best practices?