A prisoner that the Torah relates to at length is Joseph the Righteous, the son of our Father Jacob.
The imprisonment of Joseph and the reasons leading up to his incarceration are the paradigm for all those who have embarked on a mission for the good of the people of Israel and have found themselves in prison as a result.
Let us review the steps that led to Joseph's incarceration, at the end of which he was appointed as viceroy to rule over all of Egypt.
Joseph, as we all know, was hated by his brothers, who could not talk to him in peace.
His brothers went to mind their flocks far away from home, in Schem, a distance of 150 km from Hebron. They went to talk about their frustration felt over their belief that Joseph was trying to keep them from participating in the building of the Nation of Israel.
Jacob, a father who was concerned about his sons, remained in Hebron. He decided to send Joseph to ask about the well-being of his brothers and the flock. "He said to him, 'Go and see if all is well with your brothers and the sheep, and bring me back word.'"
Joseph quickly responded to his father's request, and even though he knew his brothers hated him, he did not hesitate for a moment to do his father's bidding, which was a dual-pronged mission: firstly to inquire about his brothers' welfare, and secondly to report to his father about it.
Joseph went on his way, and reached his destination, but did not find his brothers. The Angel Gabriel found him lost upon his way and asked: "Who are you looking for?" Joseph's answer was sharp and clear, "I am looking for my brothers," meaning that even if my brothers hate me they will be my brothers forever. (The word brother "ach" is derived of the same root as "mihoocha"- which means joined together.)
The angel tried to warn Joseph that his brothers' attitude towards him was unworthy and that they wanted to kill him. But the angel's words fell on deaf ears, for Joseph was in the midst of carrying out the mission his father had entrusted him with: "Go and see if all is well with your brothers." So Joseph replied only, "I am looking for my brothers." We must be amazed that Joseph dared to risk his life in spite of the angel's warning.
I believe that Joseph knew in his heart that since he was doing a genuinely good deed for his brothers by bringing them greetings from their father, Joseph knew that a sweet root never bears a bitter fruit, and it was by the power of this belief that he continued on his way.
However, as we all know, his brothers handed down a verdict of death, then commuted his sentence by casting him into a pit, so that he might die of his own accord and not by their hands, and then finally agreed to sell him into slavery.
I have often wondered what it was that went through Joseph's mind about his brothers during those dark hours down in the pit. Perhaps he said to himself: "What an ungrateful world this is. Never do favors for anyone, because ultimately everyone is ungrateful, and will even throw you into a pit - and even if they do take pity on you it is just to sell you into slavery and tell everyone, "a wild beast has devoured him." We didn't do anything! The wild beasts did!"
But in truth, when Joseph was in that very pit which was full of snakes and scorpions, he knew full well that if someone is embarked upon a mission to do a good deed, no power in the world can harm him. He knew that even though it may in the meanwhile appear that harm has befallen him, in the end this harm is really for a benefit and for a great cause.
Indeed, Joseph conquered his thoughts, and even poison snakes and scorpions cannot harm those engaged in carrying out good deeds - especially good deeds for one's brothers. Thus from that same pit the turn of events began to flow which led Joseph to Eygpt where he became the ruler over all the land.
When Joseph was elevated to viceroy over Egypt, the Almighty said of Jacob, "I am engaged in enthroning his son in Egypt, and he cries and mourns and says, why "did you cause them harm"? It is said that the ways of the world are concealed from us. This is one of the preeminent lessons of the story of Joseph. Namely that one who does a good deed will not come out the worse for it.
We find a beautiful example of this in the Seder night, when all the houses in Israel sit around the table. One of the symbols in the Seder plate is the Haroset, which as you know, is sweet. Our sages say that the Haroset commemorates the clay that our forefathers slaved with in Egypt. In keeping with this symbolism it might have seemed more appropriate that there should be a little mortar on the Seder plate, and not sweet Haroset, since our forefathers toiled in hard labor with the clay. But instead, we eat sweet Haroset, for our sages wanted to teach us the fundamental principle that indeed in the end it became clear that this same clay turned into the melting pot of the People of Israel. This same clay of slavery ultimately became the sweet mortar of Nationhood.
To conclude, let us return to the beginning of our words: a sweet root will not bear bitter fruit. G-d will not withhold good from those who follow His path. Those who do good for the Nation of Israel, shall not go unrewarded. One whose actions are for the benefit of the People of Israel shall ultimately find himself rewarded and repaid doubly for his good deeds.