Just a thought but wouldn't the ability to feel pain also create the opportunity to be tortured.
Give humanities flaws, its easy to imagine a crazed person purposefully torturing an AI. What would this AI think of their capture? what would it think of all humanity?
If anyone has seen all of the tv show Person Of Interest, they would have a good idea of the potential of AI. Granted its just a TV show but the idea that it could out grow and eventually manipulate humanity. if that AI was tortured by pain given by its creator, wouldn't it make sense that it would hate us.
You make a very interesting point. Things like that are what can cause the war of the machines where they rise to wipe us all out.