Shaykh Abdul Azeez ibn Baaz rahimahullaah in his Majmoo` Fataawaa vol. 13 pg. 363 was asked the following question:
Q: What is the ruling on transferring the organs after the passing away of one that is ‘brain-dead’ as they say?
A: The Muslim is to be honoured whether alive or dead, and what is obligatory that he is not subjected to that which harms him or distorts him from his natural form, such as breaking his bones and cutting him up, and it has been narrated from the Prophet sallAllaahu `alaihi wa sallam that he said:
“Breaking the bone of a dead person is like breaking it while he is alive.” [Reported by Ahmad no. 24218, Abu Dawud no. 3207, Ibn Maajah no. 1616, graded as authentic by al-Albaanee]
This narration is used as an evidence for the impermissibility of mutilating the dead person to benefit those that are alive; such as if his heart was taken, or his two kidneys, or other than that – as that is more severe than breaking his bones.
And the scholars have differed regarding organ donation, some of them have said: “There is a benefit in that for those that are alive, due to there being much kidney disease.”
This saying has some speculation in it; and what I hold to be closer to the truth is that it is impermissible to do so, due to the aforementioned narration, and because in doing so there is tampering with the organs of the deceased, and dishonouring him.
Also the inheritors may become greedy for the money, and therefore honouring the dead may not be attained. Furthermore, the inheritors do not inherit the dead person’s body; rather they only inherit his wealth.
And Allaah is the Granter of Success.