Praise be to Allah.
It is mustahabb when washing the deceased to remove his clothes -- this is the view of the majority of scholars -- apart from his ‘awrah, which must be covered, and there is no difference of opinion on this point.
Al-Bahooti (may Allah have mercy on him) said: Then his clothes should be removed -- this is recommended, because that makes it possible to wash him and purify him more effectively, and it is more akin to washing one who is alive, and it is more likely to protect him from impurities if it is possible that such may come out of him, and because the Sahaabah did that based on the fact that they said: We did not know whether to remove the Prophet’s clothes as we did for our dead.
End quote from Kashf al-Qinaa‘, 2/91
It says in al-Mawsoo‘ah al-Fiqhiyyah, 13/52: The Hanafis and Maalikis are of the view that it is mustahabb to remove the clothes of the deceased when washing him, because the purpose of washing is to purify and that may be done more effectively by removing the clothes, and because if he is washed in his clothes, the clothes may be made impure (najis) by what comes out, and he may not be purified. The correct opinion according to the Shaafa‘is is that he may be washed in his chemise. As for covering the ‘awrah, there is no difference of opinion concerning that. End quote.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: The correct view is that his clothes should be removed apart from his ‘awrah, which is the area between the navel and the knee.
End quote from Sharh al-Kaafi.
And Allah knows best.