Why Were Achan's Family Members Also Put to Death For Their Father's Sin?

As I was reading through Joshua today - I remembered that one of many objections against the Bible also includes the "unjust" stoning of Achan and his family. I couldn't forget how some atheists have used this passage to say that "God is unjust" - never mind that many of them believe in Richard Dawkins' famous statement that there's no good and no evil but only pitiless indifference.

So how can we handle it? First, let's take a look at this verse given in the Book of Deuteronomy:
Deuteronomy 24:16 
The fathers shall not be put to death for the children, neither shall the children be put to death for the fathers: every man shall be put to death for his own sin.

Also, if you do a review of the miserable end of Korah, we would later realize that the children of Korah didn't perish or get swallowed into Hell alive with their father:
Numbers 26:10-11 
And the earth opened her mouth, and swallowed them up together with Korah, when that company died, what time the fire devoured two hundred and fifty men: and they became a sign. [11] Notwithstanding the children of Korah died not

This would show us that God doesn't demand people be punished for the sins of their fathers. A generational curse is an effect of the sin of the fathers. We are talking about executing criminal law. God clearly defines that His moral law against crimes should only punish people according to their own sin - not for the sins of their parents. So why were Korah's children spared from the grimly fate of their father who went into Hell while alive while Achan's children were not spared? The children of Korah were revealed that they took no part in the rebellion against Moses and Aaron which makes it only fitting that they didn't die during said incident.

They would have helped him hide the things and that they must have known of them. In criminal law, both the mastermind and his accomplices all get their just punishment. No accomplice can say that they were just following orders. No mastermind of a crime can be guiltless because he himself didn't carry the act out and that they were merely giving orders. No, both the mastermind and his accomplices all get punished according to criminal law. It's impossible for Achan not to dig a hole in his tent and not his family know about it. Accomplices will always get some degree of punishment just like a druglord and his fellow drug couriers all deserve the death penalty for harming many lives because of their illicit trade.