Why did the scholars include weak ahadith in their books?
“The people of knowledge would include weak and fabricated ahadith in their books in order to make their chains – and the condition of their chains – known, and not out of dependence on and belief in them. The books of the Muhaddithin are filled with such narrations, such that some of them will mention the defects in the hadith, clarifying its status as being weak, if it was weak, or fabricated, if it was fabricated, while some of them would clarify the conditions of the narrators of a given hadith by simply providing the isnad, and would consider that they had done their duty in making this easy by simply providing the isnad, as was done by al-Hafidh Abu Nu’aym*, as well as Abu al-Qasim Ibn ‘Asakir**, and others.
So, mentioning narrators, and remaining silent about them, does not necessarily mean that a given scholar considers the hadith to be sahih (authentic), hasan (good), or da’if (weak). In fact, he could even consider it to be mawdu’ (fabricated)! In any case, his silence in regards to a hadith is not taken to mean that he sees the permissibility of acting upon it.”
['Taysir al-'Aziz al-Hamid fi Sharh Kitab at-Tawhid'; p. 126]
* : Abu Nu’aym al-Asfahani, the author of ‘Hilyat al-Awliya”
**: Ibn ‘Asakir, the author of ‘Tarikh Dimashq’