All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
The Islamic Fiqh Encyclopedia reads: “The majority of the jurists are of the view that it is permissible to take a fee for washing the dead and that this money should be taken from the inheritance of the dead. However, the Hanafi School of jurisprudence stated that it is better to wash the dead for free. Nonetheless, if the person who washes the dead wants a fee, then he is permitted to do so if there are other people who may do the washing, otherwise he is not permitted to take a fee because (in this case) washing the dead becomes obligatory on him, and it is not permissible to take a fee for an (obligatory) act of obedience.”
As regards whether the person who washes the dead is permitted to ask the family of the dead about how the latter died, then the answer is that we are not aware of any religious prohibition in this regard, and it is narrated that it was reported to the Prophet that a man died, and he asked “how did he die?” [Ahmad]
Nonetheless, if the person who washes the dead knows that the dead died while committing a sin, then he should not ask his family for details of his death so as not to embarrass them, and he should conceal the dead if he sees anything bad in him.
Allaah Knows best.