Shaikh ul-Islaam Ibn Taymiyyah explains the impermissibility of seeking treatment through that which is unlawful (haraam), and clarifies that the analogy between the permissibility of eating that which is unlawful out of necessity and between medicinal treatment through that which is unlawful is incorrect for the reason that eating guarantees removal of hunger (i.e. that is its very nature and it customarily and necessarily leads to that result) whereas medicinal treatments do not customarily and necessarily lead to cures, since cure from disease is not by any one specific treatment or way.
In Majmoo’ ul-Fataawaa (24/272):
Shaikh ul-Islaam Ibn Taymiyyah was asked concerning the one who seeks medicinal treatment with intoxicant and swine’s flesh and other than them from the unlawful things, “Is it permitted for necessity (adh-dhuroorah) or not? And is this verse, “And He has made clear to you what is unlawful for you, except that which you are compelled towards”, regarding the permissibility of what has been mentioned (i.e. the unlawful substances) or not?
So he replied: medicinal treatment by that is not permissible, rather it has been established in the Saheeh, from the Prophet (sallallaahu alaihi wasallam) that he was asked about medicinal treatment with intoxicants and he said, “They are a disease”, and in the Sunan, from him that he prohibited medicinal treatment that which is filthy (al-khabeeth). He said, “Indeed Allaah did not place the healing of my Ummah in that in which He made unlawful for them”. And that [medicinal treatment through unlawful things] is not a necessity (adh-dhuroorah), for cure by way of them is not a matter that can be held with certainty as can satiety (removal of hunger) with the eating of meat that is forbidden. And also because cure is not designated by any one specific method, rather it can be acquired through many types of [medicinal] treatments and through other than them, as opposed to hunger, for it does not cease except with eating.
And in another place there is a further elaboration on this matter (24/268):
Those who permitted medicinal treatment with unlawful substances analogised that with the permissibility of unlawful things such as [the consumption of] the dead animal and blood for the one compelled (by hunger). This [position] is weak due to a number of angles:
The first of them: That the one compelled [by hunger] will achieve his aim with certainty by consuming the unlawful things, for when he eats them they will alleviate his hunger (keep him subsisting) and will end his necessity. As for the filthy things (al-khabaa’ith) then cure by them cannot be held with certainty, for how many are there that take medicinal treatment but are not cured. And for this reason, they permitted the use of the intoxicating [drink] to prevent choking because [as a fluid] it achieves the purpose and is particularized for that, as opposed to drinking it for [removing] thirst, for they have disputed regarding this, and they have said that it does not quench thirst.
The second: That the one compelled [by necessity of hunger] does not have any other way to end his necessity except by eating of these specific things. As for medicinal treatment, then the taking [by a person] of this filthy thing (khabeeth, i.e. intoxicant, or unlawful meat etc.) is not particularized as a means for his cure, for [medicinal] treatments are of many different types and cure can be achieved by other than [medicinal treatments] such as supplication (ad-du’aa) and incantation (ar-ruqyah), and that is the greater of the two types of medicinal treatment, to such a degree that Hippocrates remarked, “The ascription of our medicine to the medicine of the owners of temples (i.e. the religious) is like the ascription of the medicine of the infertile old women to our medicine”.
And cure (ash-shifaa) can be acquired without a [specific] chosen course (of action), rather, [it can be attained] on account of what Allaah puts into the body of innate [healing] potentials and what is similar to that.
The third: That eating the [meat of] dead animal for the one who is compelled [by necessity] is obligatory upon him in what is the apparent madhhab of the scholars and other than them, as has been said by Masrooq, “Whoever is compelled [by necessity] to eat the [meat of] the dead animal, and did not eat until he died, will enter the fire”.
As for medicinal treatment, then it is not obligatory in the view of the majority of the Scholars, rather, only a small faction of them held it obligatory, as has been said by some of the companions of ash-Shaafi’ee and Ahmad. In fact, the Scholars have disputed regarding which of the two is more superior, medicinal treatment, or having patience, on account of the hadeeth of Ibn ‘Abbaas regarding the slave-girl who used to have epileptic seizures, and she asked the Prophet (sallallaahu alaihi wasallam) to supplicate for her. So he said, “If you like, you can have patience and Paradise is yours, and if you like, I can supplicate to Allaah to cure you”, so she said, “I will have patience, but (in the course of my ailment) my [body] becomes exposed, so call upon Allaah that I do not become exposed”. So he made supplication for her that she not become exposed.
And also a portion from the Companions and Successors did not use to take medicinal treatments, rather, amongst them were those who chose illness such as Ubayy bin Ka’b and Abu Dharr, and alongside this no one showed rejection against them for abandoning medicinal treatment. Thus, when eating the flesh of the dead animal is obligatory [in the case of necessity] and [yet] medicinal treatment is not obligatory, it is [therefore] not permissible to make analogy between one and the other …
And Shaikh Ibn Uthaimeen states (Sharh Arba’een an-Nawawiyyah p.137):
Eating [the meat of] the dead animal when hungry, when nothing else can be found, is something by which the necessity is repelled (i.e. removed).
As for medicinal treatment with what is unlawful (muharram), then it cannot be a dhuroorah (necessity) for two reasons:
Firstly: that the ill person can be relieved (of his illness) without medicinal treatment, and thus there is no necessity.
Secondly: That a person may take medicinal treatment [through what is unlawful], and not be relieved [of his illness] and thus his necessity is not repelled by way of it.
For this reason, the saying of the common people that “it is permissible to take medicinal treatment through the unlawful due to necessity”, is a saying that has no authenticity to it, and the Scholars – rahimahumullaah – have textually stated that medicinal treatment through the unlawful is unlawful.
And Shaikh Ibn Uthaimeen responded to a question about the expression, “Necessities make permissible the prohibited (things)”, as occurs in Fataawaa Noorun alaa ad-Darb, in the section on tafseer:
Yes, the meaning of this expression is that when a person is compelled to [consuming] something from the unlawful in a manner that will repel the necessity, then this unlawful thing becomes permissible. An example of that is a man who is in extreme hunger and he does not have anything except a dead animal, so if he ate [the meat of] the dead animal, he would not perish, and if he did not eat he would perish, so here we would say that it is lawful for him to eat from [the meat of] the dead animal because he is in a [situation] of necessity.
Similarly, if he did not have anything with him except the flesh of the pig, and he is severely hungry, and if he ate from its flesh he would remain [alive], and if he did not he would perish, then we say this is permissible because the necessities make permissible the prohibited (things).
As for what relates to [medicinal] treatment then some of the people think that this expression also applies to [medicinal] treatment and that it is permissible for a person to have [medicinal] treatment with that which is unlawful when he is compelled [by necessity] towards it as he claims. And this is incorrect because [medicinal] treatment does not repel the necessity with certainty and because sometimes he can do without it and the ill person is cured without any [medicinal] treatment. As for the first, then how many a person has had treatment with a beneficial medicine but did not benefit from it, and as for the second, how many a person has abandoned [medicinal] treatment and Allaah has cured him without any medicine.