He said: "0 my Lord! Prison is more to my liking than that to which they invite me. Unless You turn away their plot from me, I will feel inclined towards them and be one (of those who commit sin and deserve blame or those who do deeds) of the ignorants."
So his Lord answered his invocation and turned away from him their plot. Verily, He is the All-Hearer, the AllKnower. Surah 12: 33-34
That evening, Zulaikha convinced her husband that the only way to save her honor was to put Joseph in prison; otherwise she would not be able to control herself or to safeguard his prestige. The chief minister knew Joseph was absolutely innocent, that he was a young man of honor, a loyal servant, and he loved him for these reasons. It was not an easy decision for him to put an innocent man behind bars. However, he was left with no choice. He reasoned that Joseph's honor would also be safeguarded if he was kept out of Zulaikha's sight. That night, with a heavy heart, the chief minister sent Joseph to prison.