Responsibility in Islam is based on individuality which means that every one is only responsible for his own actions and not the actions of others. So, a child born through an illicit relationship is free from any responsibility towards this heinous and grave crime; hence, the community has to give him the chance to be a righteous person and treat him with sympathy and mercy.
The Standing Committee for Islamic Research and Ifta’ stated: An illegitimate child is neither condemned nor responsible for the sin of his mother and the one who committed this illicit act with her. They are accountable for this sin and the child is not responsible for what took place. This is based on the statement of Almighty Allah: [..The soul is rewarded for the good which is does and punished for the sin that is has earned…] (Al-Baqarah 2:286). He the Almighty also says: [ No soul shall bear the burden (of sin) of another…] (Al-Israa’17:15). Hence, whether or not he ends up in Hell or Paradise, depends on his obedience to Almighty Allah; doing righteous deeds and dying as a Muslim. In that case, he will enter Paradise. However, if he disobeys Almighty Allah and dies as a disbeliever, then his final abode will be Hell.
Moreover, if he has a combination of both good and evil deeds, then the decision is with Almighty Allah; if He wills He can punish him and if He wills, He may forgive and pardon him and his final abode will be Paradise by the immense bounty and mercy of Almighty Allah. The hadith which mentions that an illegitimate child will not enter Paradise is fabricated.