By Martin Štěpán
Emotions are not moral or immoral, they just measure changes in property. At most, you can say they’re bad when they’re measuring incorrectly but that’s not about morality but about the brain working sub-optimally.
I think what might also be going on is conflation with Christian deadly sins. But these, as far as I know, are judged by actions.
So, greed can motivate a rational agent to accumulate wealth by engaging in reciprocal exchanges where parasitism and predation are sufficiently dis-incentivized.
Lust can motivate one deepen connection with his mate and to produce a next generation, especially, again, where the alternatives are sufficiently dis-incentivized.
Vengeance can lead one to punish what deserves to be punished and thus dis-incentivize the recipient of vengeance from repeating it (or else removing him from the society and the gene-pool) as well as dis-incentivize other from doing the same.
Self-deception might lead to behave in more moral ways, such as when one deceives himself that there is an afterlife and morality our actions in this life will determine whether it will be pleasurable or painful.
Empathy can often be extended to people who deserve none or who cannot or wouldn’t reciprocate, enabling parasitism.