Emotions can be a useful input to the fitness function.
Each AI must have some goals, or it would not do anything. Those goals might be general, specific, benevolent or evil. Examples are
* keep humanity alive
* keep Human X alive for as long as possible, ideally unhurt
* enslave all humans
* save the dog
* save the girl
While you can often break down if a given action would work towards that goal or against it. But usually the question is not binary. Instead the AI has to decide between many, many options of which it can only enact a limited number (due to resource constraints or because they contradict each other. 64
So the question becomes "which combination of these actions will lead to the best outcome".
And the fitness function is how it "measures" best outcome.
Let's assume the goal is to keep humanity alive.
* Action A would be to cage them all into cells, automate the production of nutrients and force-feed them
* Action B might be to enable humans to live on their own terms and protect/support them in various less invasive ways.
There are many cons and pros to each of those approaches and many of them can easily be calculated.
But some are harder to grasp and that's where emotions can become handy.
The AI might have learned that happy humans are more likely to succeed in their goals and have improved long-term survival. So happiness could be a useful tiebreaker between two options that would otherwise look equally promising.
The AI might have learned that anger can lead to humans action irrationally and this can be problematic for any long-term plans, because irrational humans tend to cross plans.
The AI might have learned that grief can reduce the productivity and happiness of humans, so it might try to save a puppy it would otherwise not care about.
In other words: the AI doesn't need to experience or even understand emotions for them to become useful input into its algorithms.
The interesting thing is that a sufficiently advanced version of this could even look like it has empathy. Some might even argue that a sufficiently advanced version of this is empathy.
A big caveat to this is that those inputs will only have a certain weight to it. So it's quite possible that the AI recognizes that a certain plan of action will produce negative emotions, but it considers other factors more important and therefore still execute the plan. This could be viewed as "cold-hearted" by those who ascribe emotions to the AI. 64