Rashi cites the Midrash that questions Dinah’s whereabouts. He explains that Yaakov, fearing Eisav’s desire for Dinah, hid her in a chest in order to prevent Eisav from seeing her. For denying Eisav this opportunity, Hashem punished Yaakov by causing Dinah to fall into the hands of Shechem. As the Midrash states, Hashem reprimanded Yaakov, saying: “You prevented the possibility of a kindness to your brother; she will instead be taken by an enemy. You denied her marriage to one who is circumcised; she will instead marry an uncircumcised infidel. You refused her marriage in a permitted fashion; she will be married in a forbidden manner.”
Horav Yerucham Levovitz, z.l., comments on this Midrash, asking where Yaakov’s sin lies? He followed the prescribed Halacha, which compares giving ones daughter in marriage to a man who is ignorant to one who ties her up and places her before a lion! (Pesachim 49b) Was it appropriate for Yaakov to have been so severely punished for not allowing his daughter to fall prey to the treacherous Eisav, the epitome of evil?
He explains that Yaakov was certainly obligated to lock Dinah in the chest. Tzaddikim however, are judged for any slight infraction of Hashem’s will. Yaakov is faulted for a slight movement; he closed the chest just a little more forcefully that was necessary, a movement detected only by Hashem. This miniscule deviation from perfection precipitated Yaakov’s punishment in the form of the Shechem ordeal and the consequent disgrace of his family. This is but a glimpse of the standard by which Hashem measures the righteous!