Giving ghusl to the deceased is a "farz e kifayah" upon Muslims. This means that if no one gives ghusl to the body, everyone will be considered sinful. If some people fulfill this farz, everyone else will be relieved of this responsibility.
The immense fazeelat of giving ghusl to the deceased has been mentioned in numerous ahadith.
In one such hadith, Hazrat Ali (may Allah be pleased with him) narrates that the Prophet (peace be upon him) said:
عَنْ عَلِيٍّ قَالَ قَالَ رَسُولُ اللَّهِ صَلَّی اللَّهُ عَلَيْهِ وَسَلَّمَ : مَنْ غَسَّلَ مَيِّتًا وَکَفَّنَهُ، وَحَنَّطَهُ وَحَمَلَهُ، وَصَلَّی عَلَيْهِ ، وَلَمْ يُفْشِ عَلَيْهِ مَا رَأَی خَرَجَ مِنْ خَطِيئَتِهِ مِثْلَ يَوْمِ وَلَدَتْهُ أُمُّهُ
"Whoever bathes a deceased person, shrouds him, embalms him, carries him, prays over him, and does not disclose what he saw of his faults, will come out of his sins as pure as he was on the day his mother gave birth to him."
۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔
دلائل:
الھندیۃ: (کتاب الصلاۃ، الفصل الثانی فی الغسل، 158/1، ط: رشیدیۃ)
غسل المیت حق واجب علی الأحیاء بالسنۃ واجماع الامۃ...... ولکن اذا قام بہ البعض سقط من الباقین.
Allah the Almighty knows best.
Darul ifta Al-Ikhlas, Karachi.