From Ibn Mas'ood (radiyallaahu 'anhumaa) who said that Allaah's Messenger (salallaahu 'alaihi wa'sallam) said:
There is to be no envy except with regard to two: A man whom Allaah has given wealth which he strives to spend righteously, and a man to whom Allaah has given the Wisdom (i.e. the Qur'aan) and he acts according to it and teaches it to others.
If he were to have envy of the people he would hope for their downfall in order to satisfy the pride that he has in himself, his vanity and the conceitedness of his mind. So he (the Muslim) knows that envy is a dangerous disease and a harmful evil and therefore keeps away from it.
As for the envy which is accepted from that which is sinful, then it is envy which does not cause the person to be afflicted by the sickness of wishing for that blessing to leave the other person. Rather he supplicates to his Lord, the One free of all imperfections, for his brother; that Allaah should protect him, and for himself; that Allaah should make him like him. As for that which is at variance with this, then it is blameworthy and to be condemned. So this emphasises that fact that the Muslim is one who is: