It's because Adam was our "representative" (Romans 5:12-15).
When God tested Adam, He was testing the human race (Romans 5:12).
Although the Bible doesn't specifically say it, I believe we'd have done exactly what Adam did if we were in his position.
I admit, it's hard to fully understand this concept, but we can trust God's justice.
"I am the Lord, who exercises kindness, justice and righteousness on earth, for in these I delight,” declares the Lord. Jeremiah 9:24
Only once did God punish an innocent man:
Jesus "was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was on him, and by his wounds we are healed." Isaiah 53:5
And the good news is this: "Just as we are now like the earthly man, we will someday be like the heavenly man." 1 Corinthians 15:45-49
------------------------For a more in-depth look at this subject, check out Bite Size Bible Study's Hisses and Whispers Bible study.