In the name of Allah, Most Compassionate, Most Merciful,
The Hanafi jurists (fuqaha) have explained in detail the ruling (hukm shar’i) with regards to marrying, and have categorized this ruling into many categories, in accordance with the situation of the individual intending to marry.
Imam al-Haskafi (Allah have mercy on him) states in his Durr al-Mukhtar:
“Marriage is necessary (wajib) when having an overwhelming level of sexual desire (tawqan). If one is certain of fornicating (zina) if remained unmarried, then it would be obligatory (fard) to marry. This is when one (m: the male) is capable of paying the dowry (mahr) and maintaining a wife, otherwise one will not be sinful for not marrying…And marrying in moderate circumstances is an emphasized Sunnah (al-Mu’akkadah) according to the preferred opinion, thus one would be sinful for not marrying, and rewarded for marrying with the intention of chastity and gaining children. The meaning of “under normal circumstances” is when one has the ability to have sexual intercourse, pay the dowry (mahr) and maintain a wife…And it will be disliked (makruh) for an individual to marry who fears being unjust to their spouse, and if one is certain of being unjust, it will be unlawful (haram) to marry.”
Allama Ibn Abidin (Allah have mercy on him) explains the above text of al-Haskafi in his super-commentary (hashiya) known as Radd al-Muhtar. He states:
“(al-Haskafi’s statement: “when having an overwhelming level of sexual desire”)…meaning in a way that one fears fornication by not marrying, because it is not necessary that by having a high level of desire one will fear fornication. And it seems that the ruling will be similar for a person who cannot prevent himself from looking at the unlawful or from masturbation, and thus, it will be necessary (wajib) to marry even if one did not fear actual fornication (zina).
(al-Haskafi’s statement: “If one is certain of fornicating (zina) if remained unmarried, then it would be obligatory”) meaning it is not possible for one to abstain from fornication except by marrying, for when one is not capable of staying away from the unlawful except through one means, that means becomes obligatory (fard)…
(al-Haskafi’s statement: “This is when one (the male) is capable of paying the dowry (mahr) and maintaining a wife”) this condition is connected to both situations, meaning Wajib and Fard. And in al-Bahr (m: name of a major Hanafi reference book known as Bahr al-Ra’iq by Ibn Nujaym) another condition has been added which is to not fear being unjust and oppressive to one’s spouse. It is stated that, if there is a clash between fearing fornication in the event of not marrying and being unjust in the event of marrying, then the former will be given preference, thus it will not be obligatory to marry, rather, it will be disliked (makruh)…because being unjust and oppressive is a sin connected to the rights of the servants of Allah, whilst the prohibition of fornication is from the rights of Allah Most High. And the right of the servant is given precedence over the right of Allah in the event of conflict between the two, for the servant is in need of his right, whilst Allah Most High is Sovereign….
(al-Haskafi’s statement: “marrying in normal circumstances is an emphasized Sunnah (al-Mu’akkadah) according to the preferred opinion”)… The proof for it being Sunnah in normal circumstances is following the example of the Messenger of Allah (Allah bless him & give him peace), and him strictly rebuking the one from his Ummah who intended to remain single for the purpose of worshipping Allah Most High, as mentioned in the two Sahih collections of Hadith (m: al-Bukhari & Muslim) when he (Allah bless him & give him peace) said: “Whosoever turns away from my way is not from me”.. Thus, marrying is more virtuous than engaging in teaching and studying, as mentioned in Durar al-Bihar, and we have stated previously that it is more virtuous than freeing yourself for voluntary worship….(and al-Haskafi’s statement: “It will be disliked”) meaning prohibitively disliked (makruh tahriman), as mentioned in al-Bahr.” (See: Radd al-Muhtar ala al-Durr al-Mukhtar, 3/6-7, Chapter on Marriage)
The same has been, more or less, been mentioned in other major Hanafi Fiqh works. See for example: Mawsili, al-Ikhtiyar li Ta’lil al-Mukhtar, 2/101, al-Fatawa al-Hindiyya, 1/267, Kasani, Bada’i al-Sana’i, 1/228 and others.
To summarize what the fuqaha have mentioned, we can divide the ruling on marrying into six categories:
1) Obligatory (fard). This is when an individual has an overwhelming level of sexual desire in a way that he/she is certain of committing fornication (zina), and there is nothing besides marriage to prevent him/her, provided one (the male) has the financial means to marry, and that one does not fear being unjust or oppressive to the spouse.
2) Necessary (wajib). This is when an individual has an overwhelming level of sexual desire in a way that one fears committing fornication, or one cannot prevent himself from looking at the unlawful or from masturbation, provided one has the financial means to marry, and that one does not fear being unjust or oppressive to the spouse.
3) Emphasized and confirmed Sunnah (sunnah al-Mu’akkadah). This is for an individual who is in a moderate state, in that the sexual desire is not overwhelming as in the above two categories, and one is capable of having sexual intercourse, paying the dowry (mahr) and maintaining a wife. Also, one does not fear being unjust to the spouse and being neglectful of other obligatory acts.
4) Prohibitively disliked (makruh tahriman). This is for an individual who fears being unjust or oppressive to the spouse, even if there is an overwhelming level of sexual desire, for the rights of servants are given precedence over the right of Allah.
5) Unlawful (haram). This is when one is certain of being unjust or oppressive to the spouse, even if there is an overwhelming level of sexual desire.
6) Permissible (mubah). Imam Ibn Abidin (Allah have mercy on him) adds this category quoting from Bahr al-Ra’iq. This is when one’s desire is not overwhelming; neither does one fear being unjust to the spouse. However, one marries solely to fulfil one’s needs and does not have an intention of implementing the Sunnah, for the reward of Sunnah will only be gained when one has the intention of following it or being chaste. If one marries with the intention of saving one’s self from sinning, it will be regarded as an act of Ibadah.