Romans 2:12
[12]For as many as have sinned without law shall also perish without law: and as many as have sinned in the law shall be judged by the law
The bible tells us that by one man sin entered the world and by another man redemption was brought to mankind. Through the sin of our first parents; Adam and Eve it declares damnation upon everyone born of a woman. But at that time there wasn't full satisfaction of God's justification system.
The law was something that God introduced in order to justify everyone that was still in sin. By reason of this young children are being justified from the curse of eternal damnation.
Romans 3:19: Now we know that what things soever the law saith,... that every mouth may be stopped, and all the world may become guilty before God.
Babies who are yet to have the ability to hear about understand what the law is all about cannot be said to be guilty despite they still possess sin. It takes one who is fully conscious of what right and what wrong is to be justified of his actions.
Children at their stage of infancy who cannot interpret and comprehend God's law and all that it entails don't deserve to be held accountable for their wrong deeds as far as the justice system of heaven is concerned. At that stage good doesn't consider them as guilty.