In the blessing for Yosef, according to Rashi, Yaakov blessed him because he extended his height so that Eisav should not look at his mother. The question is, what was Yosef scared of? Maybe before, when Rochel was barren, she thought that Yaakov may divorce her and Eisov may marry her, but now that she had Yosef and was expecting Binyomin, what was she worried of?
The answer is that it is bad for a person to be the reason for someone else’s stumble even if they did not participate. For Eisav, it is a sin to gaze at Rochel regardless how much evil he has done already, and for Rochel to be the cause of it, so Yosef shielded her from Eisav's eyes in order to protect her.
This is one of the explanations of modesty, as the Gemoro tells a story of an amoiroh who saw his neighbor digging a hole in the wall separating their gardens. When he questioned him, the neighbor answered, “if I can’t marry your beautiful daughter, let me at least look at her through the wall.” Upon hearing this, the amoiroh turned to his daughter and said, “people are sinning because of you? Go back to your earth!” and she died.
The question is, what reward was it for Yosef that the girls in Egypt climbed on the walls to see his beauty?
The answer could be as we see in the Gemoro that R’ Yochanan placed himself on the path used by the women returning from Mikva, and he explained that when they look at him, they will have children like him. From that Gemoro we see that looking at a tzadik brings upon a person the merit of having children like the tzadik and one is allowed to do this.
Just like it’s bad for a person to be the cause of an aveiroh, it is good to be the reason for a mitzvah, so this was Yosef’s reward, Mida Keneged Midah, that the Egyptian woman who looked at him had better children.
Maybe this explains the existence of G-d-fearing Egyptians who kept their cattle indoors when Moshe warned them about the plague “dever.”