Main sources of this narration
This hadith appears in the sahih books:
- In imam Malik's al-Muwatta' in the book of burial, which is the source of the hadith. The chain Malik from abu az-Zinad from al-A'araj from abu Hurrairah is among the most relaible chains of hadith.
- In Sahih Muslim in the book of tribulations and portents of the last hour.
- In Sahih al-Bukhari in the book of the afflictions and the end of the world, where you may find a longer version which was transmitted via Sho'aib ibn Hamzah another student of abu az-Zinad (the teacher of Malik) and which ibn Hajar commented saying that it corresponds to Malik's version for the common part.
An explanation out of commentaries of the hadith
I'll not quote from commentaries but summarize from them, beside the quotes I've added my major sources are:
- Fath al-Baary of ibn Hajar al-'Asqalani in which he quoted scholars such as an-Nawawi (mainly from his commentary on Sahih Muslim), al-Qurtobi, ibn'abd al-Barr, al-Qadi 'Iyad, al-Khattabi and ibn Bital and others and detailed on the discussion on the permission to wish to die (which should be explained better in this version of the hadith).
- This article on alukah.net on the hadith and its meaning which covers mainly the same topics addressed in Fath al-Baary.
Ibn Hajar further mentioned in his Fath al-Baary a different version of the hadith with an explanation of abu Hurariah from al-Hakim's (from Nishapure) al-Mustadrak on which imam a-Dhahabi agreed that it is according to the conditions of both al-Bukhari and Muslim (Source al-Mustadrak المستدرك على الصحيحين):
In the following I'll be translating from Arabic language as these translations are of my own take them carefully.
8581 - حدثنا أبو العباس محمد بن يعقوب، ثنا بحر بن نصر، ثنا بشر بن بكر، حدثني الأوزاعي، عن يحيى بن أبي كثير، حدثني أبو سلمة، عن عبد الرحمن، قال:
عدت أبا هريرة فسندته إلى صدري، ثم قلت: اللهم اشف أبا هريرة، فقال: «اللهم لا ترجعها» ، ثم قال: «إن استطعت يا أبا سلمة أن تموت فمت» ، فقلت: يا أبا هريرة إنا لنحب الحياة، فقال: " والذي نفس أبي هريرة بيده §ليأتين على العلماء زمان الموت أحب إلى أحدهم من الذهب الأحمر، ليأتين أحدكم قبر أخيه فيقول: ليتني مكانه
8581 - Abu al-'Abbas Muhammad ibn Yaqoub told us, Bahr ibn Nasr told us, Bishr ibn Bakr told us, al-Awza’i told me, on the authority of Yahya ibn Abi Katheer, from abu Salamah, from 'Abd al-Rahman, he said:
I visited abu Hurairah -while he was sick- and I supported him in my chest, then I said: Oh Allah, heal abu Hurairah. Abu Hurairah, and he said: “Oh Allah, do not take it (the du'a) back.” Then he said: “If you are able, O abu Salamah, to die, then die.” So I said: O Abu Hurairah, we love life, so he said: “By the One in Whose Hand is the soul of abu Hurairah, there will come a time for scholars in which death will be more beloved to one of them than red gold, and one of you would come to the grave of his brother and say: I wish I were in his place.”
This shows that the hadith itself applies on people who have knowledge of Allah and on people who have deep faith as some scholars say in their interpretation.
Further especially al-Bukhari and Muslim (and also al-Hakim from Nishapure) have classified the hadith in the context of afflictions (al-Fitan الفتن plural of Fitnah) to put the hadith in the correct context.
Ibn Hajar also quoted from Kitab al-Fitan -I couldn't fidn a specific source for this statement- a narrative in which abu Dharr said that people would see a janaza passing by a market and some would wish to lay there instead of the dead. Imam al-Qurtobi quoted a longer version of this in his Tadhkirah as a narrative of al-'Aamash (see here -in Arabic-).
Why would a person wish to die or to be dead?
Because of the fear for ones faith from the increase and strengthening of the fallacy, the disbelief and falsehood (and the people who are inviting to them and practicing them), and from all the things a Fitnah may cause, such as falling into sins and the spreading of evil.
This also is explained in a version of the hadith in Sahih Muslim and Sunan ibn Majah saying:
By Him, in Whose hand is my life, the world would not come to an end until a person would pass by a grave, would roll over it and express the desire that he should be in the place of the occupant of that grave not because of religious reasons but because of this calamity.
Scholars agree therefore say only good people would wish to die for such reasons therefore the hadith only applies to faithful people in general and scholars in special.