Rabbi Yudah son of Rabbi Simon said in the name of Hezekiah: This is one of the verses that our master (Rabbeinu) would expound favorably. "[the women] that they lay with, the women" (1 Samuel 2:22) — is it possible that the sons of that righteous man would do such a thing? Say therefore: because [the women] would bring up holy offerings to Shiloh, [the sons] would detain them and lodge them away from their homes for one night, [and] the Holy One, blessed be He, accounts it against them as though they had lain with them. And likewise: "And his sons walked not in his ways, but turned aside after lucre" (1 Samuel 8:3) — is it possible that the sons of that righteous man would do such a thing? Say therefore: because they would take the tithe and adjudicate with it. Rabbi Berekhiah said: A caravan [mevrakhta — term uncertain] used to pass through Beersheba, and they would set aside the needs of the community and busy themselves with their own needs. And likewise: "and she sat in the opening of Enaim" (Genesis 38:14) — is this possible? Rather, she sat at an opening where all eyes (einayim) are turned toward her. She said: May it be [Your] will that I not go out from this house empty.
Reading Eli's Sons, Samuel's Sons, and Tamar to Their Merit
Midrash Shmuel 7:4
רבי יודה ברבי סימון בשם חזקיה זה אחד מן המקראות שהיה רבינו דורש לשבח, את אשר ישכבון את הנשים (שמואל א' ב' כ"ב), אפשר בניו של אותו צדיק היו עושין כן, אמור מעתה על ידי שהיו מעלות הקדש לשם לשילה היו משהין אותם ומלינים אותם חוץ מבתיהן לילה אחד, מעלה עליהן הקדוש ברוך הוא כאלו שמשו עמהן, ודכותה ולא הלכו בניו בדרכיו ויטו אחרי הבצע (שמואל א' ח' ג'), אפשר בניו של אותו הצדיק היו עושין כן, אמור מעתה על ידי שהיו נוטלין את המעשר ודנין בו, אמר רבי ברכיה מברכתא היתה עוברת בבאר שבע והיו מניחין צרכי צבור ומתעסקין בצרכי עצמן, ודכותה ותשב בפתח עינים (בראשית ל"ח י"ד), אפשר כן, אלא ישבה בפתח שכל עינים מצפות לה, אמרה יהי רצון שלא אצא מן הבית הזה ריקם.