It was the first born sons , which would usually carry on the evils of the fathers. And Exodus 12:23 states God will protect the homes marked with the blood of the lamb from the destroyer. In other words he protected those willing to turn from evil, as so commanded. Those that would continue their free will given them at birth, in which they chose evil, would not and would reap the plague themselves from the destroyer, which as we know in the beginning was unleashed by eating of the forbidden fruit.
They were warned and did not take heed.
They chose their fate.
That is my humble interpretation of it.
Fortunately for us, God realized, due to free will, there was no one free from sin, and sent His Son to die for us on the cross, so we may be saved from our sins. “Father, forgive them, as they know not what they do.” He redeemed his goodness through the resurrection, that those that follow Him and accept Him as their savior, He will give us eternal life in heaven, free from all ills of the world.
You miss the point
Innocent children were killed because of the actions of adults