You don't have to be an asshole to be dangerous though is the point. When you are thinking of hurting someone it's not typically due to malice, hate it's usually because it's a threat and out of self defense. That's a core part of being an animal/living thing, so it would be no different for an AGI.
Defining these values exactly is impossible, which is why solving this problem is so difficult.
I say it's impossible to solve because defining it is impossible. No two groups have the same end goals, so there will be conflict for survival at some point - and that is inherently dangerous to one group.
Even if you programmed an AGI to want humanity to exist, it could determine (probably rightfully) that humanity is the biggest threat to humanity, and just lock us into a pleasure loop as a species. These and many other scenarios have been discussed ad-nausea in which an AGI with human goals ends up giving us what we want and it's not something anyone would ask for, but would give the end result.
Ironically, this is what was described in the first Matrix movie - and if you take it to it's logical extent it makes sense. I'm not even a sci-fi person so it almost pains me to reference sci-fi, but I think it's apt:
Did you know that the first Matrix was designed to be a perfect human world. Where none suffered. Where everyone would be happy. It was a disaster. No one would accept the program. Entire crops were lost. Some believed that we lacked the programming language to describe your perfect world. But I believe that as a species, human beings define their reality through misery and suffering. The perfect world would dream that your primitive cerebrum kept trying to wake up from. Which is why the Matrix was redesigned to this, the peak of your civilization. I say your civilization because as soon as we started thinking for you it really became our civilization which is of course what this is all about. Evolution, Morpheus, evolution, like the dinosaur. Look out that window. You had your time. The future is our world, Morpheus. The future is our time.