The Messenger of Allah ﷺ said, "The child born of adultery is the worst of the three."Abu Hurairah said, "For me to lend out a whip for use in the cause of Allah is dearer to me than to free a child born of adultery."
قال رسول الله ﷺ: ولد الزنا شر الثلاثة. قال أبو هريرة: لأن أمتع بسوط في سبيل الله أحب إلي من أن أعتق ولد زنية.
Abu Dawud (3963) narrated it from Ibrahim bin Musa, who said, Jareer informed us, from Suhayl bin Abu Salih, from his father, from Abu Hurairah, and he mentioned it. Ahmad (8098), Hakim (2/214, 4/100), and Bayhaqi (10/57, 59) all narrated it through various chains from Suhayl bin Abu Salih in similar fashion. Hakim said, "It is sahih according to the criterion of Muslim." Bayhaqi mentioned the statement of Sufyan, "meaning, if he acts according to the deeds of his two parents." It has also been narrated as a raised report (marfu), but that is not sound.The scholars have differed regarding the interpretation of this hadith, because Allah Most High says, "No bearer of burdens shall bear the burden of another" [Anam 6:164]. It has been said that this hadith came in reference to a specific man who was marked by evil. It has also been said that its meaning is that he is the worst of the three in origin, in essence, in lineage, and in birth, because he was created from the fluid of the fornicator and the fornicatress, which is a foul fluid. Khattabi mentioned this.As for the interpretation of Sufyan, it is not specific to the child born of fornication, but rather applies to anyone who does the deeds of his two parents, when they are engaged in evil such as disbelief, hypocrisy, fornication, or sinfulness, for he is then attached to them.