In the human court system a person has to undergo a trial, a sentence and the punishment
Mizpah - but you don't have to go to trial for something your parent or ancestor has done. But I agree that if one believes in the bible then you have to accept that God sits in judgement over mankind. In my view though the God of the bible, especially the old testament is not very just. There are many accounts of his unjust decisions. 2 Sam 24:13 shows that God sends a pestilence to kill 70,000 men because David had conducted a census. What did these 70,000 men do wrong?
Maybe Yahweh should apply his own words at Deut 24:16 "The fathers shall not be put to death for the children, nor shall the children be put to death for the fathers; every man shall be put to death for his own sin" (RSV)