The answer is that we are not certain that this claim is true. The authenticity of the hadith is not beyond question, and the conclusion derived from it is also disputable. If it is true and authentic then it is because both the murderer and victim were disbelievers, and disbelievers end up in hell.
Note that there are various madhabs on the fate in the afterlife of the children of disbelievers who die in infancy:
They will be in Heaven. This is claimed by some scholars as the most correct view. Some of the evidence cited for it includes:
وإذ أخذ ربك من بني آدم من ظهورهم ذريتهم وأشهدهم على أنفسهم ألست بربكم قالوا بلى شهدنا
And [mention] when your Lord took from the children of Adam - from their loins - their descendants and made them testify of themselves, [saying to them], "Am I not your Lord?" They said, "Yes, we have testified."
— Quran 7:172
The children took the Shahada before birth. When they died in infancy without having done any deeds or followed any religion, then they died on their previous state. They died Muslims and hence should be in Heaven.
فأقم وجهك للدين حنيفا فطرت الله التي فطر الناس عليها لا تبديل لخلق الله ذلك الدين القيم ولكن أكثر الناس لا يعلمون
So direct your face toward the religion, inclining to truth. [Adhere to] the fitrah of Allah upon which He has created [all] people. No change should there be in the creation of Allah. That is the correct religion, but most of the people do not know.
— Quran 30:30
The children are created on fitrah, i.e. Islam. When they died in infancy they died without committing any act which would nullify their faith. Hence they died on Islam and should be in Heaven.
كل مولود يولد على الفطرة، فأبواه يهودانه أو ينصرانه أو يمجسانه
Every child is born on fitrah and his parents convert him to Judaism or Christianity or Magianism
— Sahih Bukhari
Similar to the above, the children are born on Islam and they died on it, so they died as Muslims and should be in Heaven.
وأما الرجل الطويل الذي في الروضة فإنه إبراهيم صلى الله عليه وسلم، وأما الولدان الذين حوله فكل مولود مات على الفطرة - قال: فقال بعض المسلمين: يا رسول الله، وأولاد المشركين؟ فقال رسول الله صلى الله عليه وسلم: وأولاد المشركين
And the tall man whom you saw in the garden, is Abraham ﷺ and the children around him are those children who die on Fitrah
Some Muslims asked the Prophet, "O Allah's Messenger (ﷺ)! What about the children of polytheists?"
The Prophet (ﷺ) replied, "And also the children of polytheists."
— Sahih Bukhari
This is affirmation that the children of the disbelievers will be in Heaven.
They will be in Heaven, as servants of the people of Heaven.
سألنا رسول الله صلى الله عليه وسلم عن أطفال المشركين، فقال: هم خدم أهل الجنة
The Messenger of Allah (ﷺ) was asked about the children of the polytheists. He said: They are the servants of the people of Paradise.
— Mu'jam al-Kabir Tabarani
Some of them will be in Heaven and some in Hell, reliant upon the knowledge and will of Allah.
سئل النبي صلى الله عليه وسلم عن ذراري المشركين، فقال: الله أعلم بما كانوا عاملين
The Prophet (ﷺ) was asked about the offspring of polytheists; so he said, "Allah knows what sort of deeds they would have done."
— Sahih Bukhari
They will be tested in the after-life.
يؤتى بأربعة يوم القيامة: بالمولود، وبالمعتوه، وبمن مات في الفترة، والشيخ الفاني، كلهم يتكلم بحجته، فيقول الرب تبارك وتعالى لعنق من النار: ابرز، فيقول لهم: إني كنت أبعث إلى عبادي رسلا من أنفسهم، وإني رسول نفسي إليكم، ادخلوا هذه، فيقول من كتب عليه الشقاء: يا رب، أين ندخلها، ومنها كنا نفر؟ قال: ومن كتبت عليه السعادة يمضي، فيتقحم فيها مسرعا، قال: فيقول تبارك وتعالى: أنتم لرسلي أشد تكذيبا ومعصية، فيدخل هؤلاء الجنة، وهؤلاء النار
Four (kinds of people) will be brought forth on the Day of Resurrection: the infant, the insane, the one who died during the Fatrah and the very old man. All of them will speak in their own defense.
Then the Lord, may He be blessed and exalted, will say to a neck of Hell, ‘Come forth!’ and He will say to them, ‘I used to send Messengers to My slaves from amongst themselves. Now I am the Messenger of Myself to you. Enter this (i.e., the Fire).’
Those who are decreed to be among the doomed will say, ‘O Lord, how could we enter it when we are trying to escape it?’ And those who are decreed to be among the blessed will rush to enter it.
And Allah will say: ‘You would have been more disobedient towards My Messengers.’ So those will enter Paradise and those will enter Hell.
— Musnad Abu Ya'la
They will be in-between Heaven and Hell and would not enter either.
They will be turned to dust and cease to exist.
They will be in Hell. This view holds that children are subject to the same status as their parents; unless they act and change it. So the child of a disbeliever is also initially a disbeliever. If it dies in infancy it died on disbelief and would be in Hell.
Some of the evidence claimed for this view includes:
إنك إن تذرهم يضلوا عبادك ولا يلدوا إلا فاجرا كفارا
Indeed, if You leave them, they will mislead Your servants and not beget except [every] wicked one and [confirmed] disbeliever.
— Quran 71:27
Similarly some ahadith are cited for it, such as the one you have quoted.
The reply for the verse is that it can not be used as evidence for a general ruling, since Noah's prayer was specific to his people and was based on knowledge that Allah had already given him:
وأوحي إلى نوح أنه لن يؤمن من قومك إلا من قد آمن فلا تبتئس بما كانوا يفعلون
And it was revealed to Noah that, "No one will believe from your people except those who have already believed, so do not be distressed by what they have been doing.
— Quran 11:36
The applicability, authenticity and correctness of the ahadith cited for this position is also disputed.
Arguments are also made against this view based on:
وما كنا معذبين حتى نبعث رسولا
And never would We punish until We sent a messenger.
— Quran 17:15
An infant would not have received the message, nor been able to comprehend and accept it. Hence it should not be punished.
وإذا الموءودة سئلت بأي ذنب قتلت
And when the girl [who was] buried alive is asked, for what sin she was killed
— Quran 81:8-9
This verse exonerates the infant of any sin and condemns the punishment that she was given without cause. When this is the case, it is unreasonable that Allah Himself will punish her for no act on her part.
ولا تكسب كل نفس إلا عليها ولا تزر وازرة وزر أخرى
And every soul earns not [blame] except against itself, and no bearer of burdens will bear the burden of another.
— Quran 6:164
A child being a disbeliever and getting punished in the hereafter just because of its parents is contrary to this verse.
It is unknown. Some of the scholars adopted the view that Allah knows best about what will happen and preferred to leave it at that. We do not need to hold a belief on the matter as it is not a part of essential creed.
References: Fath al-Bari and Tafsir al-Qurtubi and Tafsir Ibn Kathir