AIs are like every other computer program - perfectly naive. If you train them on bad data, you get bad results. Garbage in, garbage out.
If your data set was compiled by thousands of mechanical turk workers, well, you got a lot of people to blame a little bit. As it goes, "everybody is a little racist sometimes..." and apparently that shows on a big enough data set.