Why does an illegitimate child not inherit?

1. Why has an illegitimate child not been made a beneficiary of the wealth and money of his father, moreover he can’t adopt his name, socially not an individual which other child can be. In spite of him being innocent, why has he been refused with all the bounties a child enjoys?

2. If his mother and father repent for their deeds, still the child will be facing all the hardships and trauma of not being a legitimate child. Would the father still be liable for his zina even after repenting? If not then how would the child be given justice for something which his parents did and he is being paying off?