There are two sides to the coin. What you call "envy" has a very good (evolutionary) reason for its existence.
Take a look at ultimatum game (https://en.wikipedia.org/wiki/Ultimatum_game). If people didn't have capacity to deny unfair splits, even though they seem irrational, then they would be worse off.
I posit that denying unfair splits in ultimatum game is envy. Think about it, envy is the reason to do it - the other party doesn't deserve the bigger split, so let's kill it for both! The similar game can be for instance used as a model of worker's strike against a capitalist.
(I think in fact most people consider envy a vice only where it's extreme or there are other circumstances that make it unfair. But in general it's just an expression of longing for fairness.)