We cannot hold the “bastard” children responsible since they are the innocent victims and had no choice in their circumstances. It would be better to hold their parents responsible instead.
It is less about punishing the children, and more about limiting the damage. It was a way of saying “look at what you will be doing to the child and youself!”