A Mubaah Or Mandoob Act Will Be Prohibited Because Of Its Collusion With Other Non-Shar'i Acts
A Mubaah act which may also be Mustahab, if it is coupled with a non-Shar`i act will become prohibited. For example to accept an invitation is Mustahab, Sunnat in fact, but if one answers to an invitation where some un-Islaamic things are taking place then to got there will be prohibited. Also for example, it is mentioned in the Ahaadith and it appears in Hidaaya that it is laudable to perform Nafl Salaat, but if it is performed during the Makrooh times, it will be prohibited and even be sinful. From this we understand that even though an act may be permissible and laudable, if it is coupled with some un-Islaamic or ghair-mashrooh factor, then this permissible act will become impermissible. [Islaahur Rusoom, page 132]
If There Is A Wrong Belief Regarding A Mandoob Act, Then It Is Waajib To Abandon It
The Fuqahaa have written that if some concocted belief becomes attached to a Mustahab act, then it will be necessary to abandon that act. [Hasnul Azeez, page467, vol. 1]
The Fuqahaa have written that it is Waajib to abandon that Mustahab act in which some false belief has cropped into. It will not be permissible to censure anyone for abandoning (such) a Mustahab. If carrying out a Mustahab act creates some fasaad, then that Mustahab act should be abandoned. [Ibid. page 680]
When there exists a conflict between benefits and harms When there exists a conflict between masaalih and mafaasid, then the effects of the mafaasid are granted preference, as long as the masaalih have not yet reached a point of Shar`i necessity. [Imdaadul Fataawa, page 69, vol. 4]
The Shar`i ruling is that when the mafaasid in any action is overwhelming, and that action is not sought (in the Shariah, i.e. not amongst the compulsory acts), then the actual action will be prohibited. If the action is one that is sought (in the Shariah), then the action will not be abandoned, rather the mafaasid will be terminated and prevented. [Ibid, page 84, vol. 4, Bawaadirun Nawaadir, page 334, Bayaanul Qur`aan page 119, vol. 3]
If there is some benefit in an act which is contrary to the Shariah, and there may also be good reasons for executing that act, but its execution is not deemed necessary in the Shariah, or there are other means in fulfilling the same benefits, and the act may be carried out solely for the good intentions, its execution will still be impermissible. [Islaahur Rasm, page 134]
The Proof Of The General Ruling And The Two Types Of Mufsid
It is a fiqhi ruling that a permissible, in fact Mustahab, act, which is not sought by or importance attached to it by the Shariah, becomes overwhelmed by mafaasid, should be abandoned. Regardless of whether the mafaasid is due to the action of the executers or the act of the onlookers.
This ruling is both, aqli and naqli. The Hanafi Fuqahaa have extracted numerous corollaries from this ruling. The ruling is that if there exists any Mubaah or mandoob act, which in the Shariah has not attained the level of necessity and there is a possibility that it creates fasaad amongst the masses (when it is rigidly adhered to or elevated in importance), then this Mubaah or mandoob must necessarily be prohibited from and abandoned. The aqli (logical) argument for this is clear and the naqli argument is in the Aayat, "And do not insult those whom they (the kuffaar) worship besides Allaah, lest they insult Allaah wrongfully without knowledge..."
It is clear that to censure the baatil 'gods' is a necessary permissible act, and in some cases it is mandoob also, but because it is not an objective in itself, in fact this objective (of 'teaching' the nonbelievers) can be attained in other ways, like through wisdom and counsel, and there is a possibility that this method (of censuring) will lead to them hurling abuse at Allaah Ta`ala, hence it has been forbidden. [Imdaadul Fataawa, page 826, vol. 1]
Explanation Of An Example With Proofs
The Hadith has permitted the performance of Sajdah-e-shukr, however, the Hanafi Fuqahaa have, according to the statement of Allaamah Shaami (rahmatullah alayh), ruled it to be Makrooh, lest the masses deem it an objective in itself (i.e. make it a special act of Ibaadat). It is stated in Aalamgiri that since people have begun making it (with perpetuity) after Salaat, hence it is Makrooh, because the ignorant people would begin deeming it to be Sunnat or even Waajib. When any permissible act reaches this stage (that people start elevating its position), then it becomes Makrooh.
However, as for that act which is necessary, it should not be abandoned. Whatever fasaad has crept into such acts must be eradicated and reformed. For example, if in a certain janaaza there is a nauha (professional mourner) who is also present, now in order to evade this Makrooh act, one should not absent oneself from that janaazah. In fact, that woman can be and should be prevented from plying her trade there. Due to this temporary abhorrence, a necessary act should not be abandoned.
Contrary to being invited to a place where Makrooh acts are also perpetrated. There the invitation should not be accepted, because this (i.e. accepting an invitation) is not amongst the necessary (ordered) acts of the Shariah.
Allamah Shaami (rahmatullah alayh) has also cited the differences between these mas`alahs. [Islaahur Rusoom, page 110]
[The Principles And Codes Of Law In Hanafi Fiqh, Moulana Ashraf Ali Tahaanwi رحمه الله]