Bava Basra 21a: Jealousy of scholars leads to more scholarship.
בבא בתרא כא ע”א: קנאת סופרים תרבה חכמה
A couple once came to Rabbi Shmuel Berenbaum with a question: the wife wanted to buy an expensive luxury car, but the husband was worried that this might give rise to jealousy and ayin hara. Reb Shmuel lifted his eyes from the sefer he was learning and asked the man a seemingly unrelated question, “Do you already know Nashim and Nezikin?” “The rosh yeshiva sees that I don’t sit and learn all day,” the man replied. “Do you know at least one masechta well?” asked Reb Shmuel. “No,” said the man softly. “Do you know at least one daf Gemara by heart?” The man lowered his eyes and admitted, “Unfortunately, although I try to be kovea itim for Torah, I don’t learn it well enough to know the Gemara by heart.” “If so,” Reb Shmuel said, “you have nothing to worry about. You can buy the car – no one has anything to be jealous of you for.”
[We know that there are two types of jealousy: jealousy of physical possessions, which is wrong and may cause ayin hara, and jealousy of someone else’s Torah accomplishments, which is good and admirable, as our Gemara says, and will not lead to ayin hara. In this story, it seems that Reb Shmuel was not afraid of jealousy of the first kind – he assumed people are above that level. But what if the man had replied that he was a talmid chacham who knew Shas? Why then would Reb Shmuel have told him not to buy the car? If people are above jealousy of a car, why would they suddenly be jealous of it if he knew Shas? And if people would be jealous of him for knowing Shas, then good – קנאת סופרים תרבה חכמה!
The answer, explained Rabbi Elya Boruch Finkel (Mishulchan R’ Eliyahu Boruch, Parshas Vayikra) is that there is a third type of jealousy: jealousy of another person’s Torah accomplishments or mitzvos that he was able to do because Hashem granted him more money or a better mind. This, says the Ibn Ezra, is why the Torah says that the middle level of a קרבן עולה ויורד is to bring both a chatas and an olah – unlike the wealthy man, who brings only a chatas. The olah is to atone for the sinner’s thoughts of envy toward the wealthy sinner, who has the means to bring a nicer korban. But why wasn’t he envious of his possessions until now? The answer is that we don’t assume he is on such a low level. It doesn’t bother him that someone else has a nicer house or car. But it does bother him that he has a nicer korban.
Reb Shmuel’s point was that it’s good to be jealous of someone for knowing Shas, because that will motivate you to learn better. But if you see a man driving a luxury car who knows Shas, you might think, “The only reason he has time to sit and learn so much is because he has money. If I had money I would also become a talmid chacham.” That is the wrong kind of jealousy, the kind that might cause ayin hara.]