His statement, “and sleeping”: It is recommended for one in a state of major ritual impurity, when he wishes to sleep, to perform wudu. Evidence for this is the hadith of Umar, may Allah be pleased with him, who said: “O Messenger of Allah, may one of us sleep while in a state of major ritual impurity?” He replied: “Yes. When one of you performs wudu, let him sleep while in a state of major ritual impurity.” (1) Another wording states: “Perform wudu, wash your penis, then sleep.” (2) ...
This evidence indicates that it is obligatory, because he said, “Yes, if he performs wudu.” Making something permissible contingent upon a condition indicates that it is not permissible except with that condition. Accordingly, wudu for one in a state of major ritual impurity before sleeping would be obligatory. This was the view held by the Zahiris and a large group of scholars (3). However, the well-known position among the jurists and the leading imams is that it is recommended (4). They cited as evidence the hadith of Aishah, may Allah be pleased with her, that the Prophet, peace and blessings be upon him, “would sleep while in a state of major ritual impurity without having touched water.” (5)