Chazal mention several exceptional blessings that Yosef received as a reward for withstanding this nisayon. Firstly, in his merit, the daughters of Tzelafchad, who were from Shevet Yosef, warranted a Parashah in the Torah written through them. Also due to his righteousness, his descendants forever are shielded from the influence of עין הרע.
Another remarkable privilege Yosef was rewarded with for shielding his eyes, was related to the Mishkan which was in Shilo, in the Nachalah of Yosef. Halachically, whilst the Beis Hamikdash stood in Yerushalayim, certain korbanos were only allowed to be consumed within the city walls. However, whilst Mishkan Shilo was standing, the consumption of these korbanos was permitted within the whole area from where the Mishkan could be seen.
Chazal tell us that this was a reward for Yosef's Shmiras Eineiyim. The Sfas Emes adds that through guarding his eyes, Yosef sanctified not only himself, but he also made the whole place holy. Through being מְקַדֵּשׁ his eyes, he sanctified the whole area around Shilo, rendering it holy enough to allow the consumption of Korbanos in it. (שפת אמת ויחי תרל"ח) Here, he was awarded measure for measure - through guarding his eyes, he received schar in the form of eyesight.
Hearts and Eyes for Hashem
In fact, the Yerushalmi states that one's devotion to Hashem is measured by the level of his שְׁמִירַת עֵינַיִם. Hashem tells us "תְּנָה בְנִי לִבְּךָ לִי וְעֵינֶיךָ דְּרָכַי תִּצֹּרְנָה" My son, give Me your heart; your eyes should watch My ways. (משלי כג כו) Rebbi Levi explains that the heart and eye are the two agents of sin. In this possuk, Hakadosh Baruch Hu says to every one of us: "אי יהבת לי לבך ועיניך אנא ידע דאת לי", If you give Me your heart and eyes, I know that you are Mine. (תלמוד ירושלמי ברכות פ"א ה"ה)
These words of Chazal reiterate how this is a most core component of our Avodas Hashem. Living a Torah life and fulfilling all the mitzvos is still not enough to prove our dedication to Hashem; we must also fully commit to guarding our eyes in order to be regarded as "belonging" to Him.
To demonstrate this idea, Reb Elazar Azkari, the Ba'al Hacharedim, offers a profound mashal. A wealthy man gifted his friend with a thousand slaves to make his friend's life easier. The friend happily accepted them and enjoyed the luxury of being served by so many. After some time passed, the wealthy man asked his friend to return only two of the servants he had given him, but the friend flatly refused. "Why," he said, "I have so much use of them, it would be such a shame to give them back!" Surely, someone with such behavior would be viewed as an ungrateful and selfish person. His actions clearly display his ingratitude towards his benefactor.