Those sons were innocent. Some of them were even babies. Why did God do such an unjust act?
Some would answer that He did that because he’s God or showing his authority. Then why did he sacrifice those innocent kids? That’s not just or loving.
I am not challenging the Bible but just seeking the truth.
From the point of view of justice the first thing we see in the Bible is in the Old Testament. It is not mercy, but an eye for an eye.
Remember how God punished all the Jews for the sin of David the King? Now fast forward and see God forgives His people, for the sacrifice of Christ the King. The fate of the people is linked to the actions of the king and somehow that is just. You would not complain that you get to avoid hell, because King Jesus suffered and died for you, but how is that just?
Now go back and look at the story of the Egyptians and the Jews. The Jews were the slaves of the Egyptians for generations. Was that just? The Egyptian pharoah ordered the execution of all of the firstborn sons of the Jews and it was carried out. Only Moses escaped, by being cared for by Pharoah’s daughter. If all the Jews of the Old Testament were punished for David’s sin of taking a census, then what should happen to the Egyptians for the sin of Pharoah for murdering all of the firstborn sons of the Jews? What does justice demand?
Your problem is not with God’s justice. You expect Him to be merciful and not repay the Egyptians for their crime.
There is mystery here. We can’t grasp all of what is being presented. We do not know the eternal fate of the souls of the Egyptian children and adults who were firstborn sons.
The physical history of the Jews prefigures something spiritual. As they were led out of slavery after the first Passover, the event you are thinking about, they spent forty years in the desert on the way to the physcal promised land, prefiguring the spiritual promised land, heaven.
Jesus died for our sins and we long and pray for the coming of His Kingdom, but it is not here yet. He can reign in souls, but the world is a mess. Our sins can be forgiven, but we are wnadering in the wilderness still. The world is full of darkness and struggle as the Jews struggled in the desert with no homeland.
Pharoah in this spiritual lesson of history in typology is Satan. He was the head of all of the slave drivers who enslaved and whipped the people, as the human race is enslaved in sin by a cruel master and demons. God is more powerful than the devil and sets His people free and destroys the demons and those horsemen who try to prevent the freedom of His people.
We are to see in this physical history overlayed by spiritual and divine events a reflection of our own spiritual lives.