We read in Parashat Vayigash of the gifts that Yosef gave his brothers immediately after revealing to them his identity. The Torah relates that Yosef gave each of his brothers a new garment, but he gave Binyamin five new garments and three hundred silver coins (45:22).
The Gemara in Masekhet Megilla (16b) raises the question of how, after all that Yosef and the family had suffered as a result of the preferential treatment he received from his father, Yosef could now make this very same mistake. Yosef, more than anybody else, should have been wary of the disastrous consequences of treating one brother better than the rest, and yet he gave Binyamin a much larger gift than he gave his brothers. The Gemara answers that Yosef’s gift to Binyamin was given to foreshadow the events that Binyamin’s illustrious descendant, Mordekhai, would experience, when he was given five special garments upon being named vizier.
It is worth noting the Gemara’s formulation in posing its question regarding Yosef’s conduct: “Is it possible that this righteous person would stumble regarding the very matter on account of which he suffered?” (“Efshar davar she-nitzta’er bo oto tzadik yikashel bo?”). Interestingly, the Gemara does not question how a righteous person like Yosef could make this kind of mistake. After all, Yosef’s father, Yaakov, who is generally regarded as no less righteous a person than Yosef, made this mistake. Rather, the Gemara asks how Yosef could make the same mistake that caused him such distress. What surprised the Gemara was not that the mistake was made by a person of Yosef’s stature, but rather that it was made by a person of Yosef’s stature who experienced firsthand the consequences of this mistake. (This observation was made by Rav Chaim Elazary, in his Mesilot Chayim.)
From the Gemara’s perspective, a “tzadik” is not a person who never makes mistakes, but rather someone who learns from his and other people’s mistakes. Our goal in life is not to be perfect, but to move closer to perfection by learning from every failure and misstep. And thus the prospect of Yosef Ha-tzadik erring did not startle Chazal; they questioned only the prospect of Yosef Ha-tzadik repeating a mistake made by his father on account of which he suffered for so many years. It is understandable that Yosef would not be perfect, but it was impossible to imagine that he would not learn and implement the lessons of his experiences.