The Prophet ﷺ said: The child of adultery is worst of the three. Abu Hurairah said: That I give a flog in the path of Allah (as a charity) is dearer to me than emancipating a child of adultery. (Using translation from Abū Dāʾūd 3963)
قَالَ رَسُولُ اللَّهِ ﷺ «وَلَدُ الزِّنَا شَرُّ الثَّلَاثَةِ» قَالَ أَبُو هُرَيْرَةَ «لَأَنْ أُمَتَّعَ بِسَوْطٍ فِي سَبِيلِ اللَّهِ أَحَبُّ إِلَيَّ أَنْ أُعْتِقَ وَلَدَ زِنْيَةٍ»