Chagigah, Chapter 1, Mishnah 7. In the previous Mishnah we learned that someone who did not bring his festival offerings on one of the days of the festival can no longer make them up, and he has forfeited his opportunity. On this the Mishnah cited the verse in Koheles: "That which is crooked cannot be made straight, and that which is lacking cannot be counted." Our Mishnah brings other interpretations of that same verse, applying it to entirely different matters.
Rabbi Shimon ben Menasya says:
"Eizehu me'uvas she'eino yachol litkon? Zeh haba al ha'ervah v'holid mimenah mamzer" - Which is a crookedness that cannot be made straight? One who cohabited with a woman forbidden to him and a mamzer was born from it has caused a distortion that has no remedy. The mamzer cannot marry into the Jewish people; and even if he marries a mamzeres, which is permitted to him, further mamzerim are destined to be born from him.
The Mishnah contrasts this with other transgressions: "Im tomar b'gonev v'gozel, yachol hu l'hachaziro viyetaken" - the thief and the robber, though their deeds are severe, are able to return the object and repair what they distorted. But one who fathered a mamzer has brought into the world a new reality that he has no power to undo.
Rabbi Shimon ben Yochai says:
"Ein korin me'uvas ela l'mi shehayah mesukan batechilah v'nis'aves" - the term 'crooked' is used only regarding something that was straight and in good order to begin with, and only afterwards became bent. "V'eizeh? Zeh talmid chacham haporesh min haTorah" - a Torah scholar who was in good order and straight, and then withdrew from the study of Torah, Heaven forbid. He is the one who has become crooked, and this is "that which is crooked cannot be made straight" - unless he repents.
In summary: In this Mishnah we learned two additional interpretations of the verse "That which is crooked cannot be made straight." According to Rabbi Shimon ben Menasya, it refers to one who cohabited with a forbidden woman and fathered a mamzer from her, who has no way of restoring the situation to what it was, unlike the thief and the robber, who can return the object and repair the damage. According to Rabbi Shimon ben Yochai, the term 'crooked' applies only to one who was in good order and then became crooked, namely a Torah scholar who withdraws from the Torah, whose remedy is repentance.