Why did G-d let that happen? Because the serpent has a purpose, to test our Yezter hara. Adam was tricked by satan because was put here to test us so that we can grow. Without pressing us, testing us, finding out where we are at, forcing us to grow, we wouldnt ever grow. G-d created satan to test us so that we could grow.
Adam wasn't tricked per se. What was Adam told? '
You will not surely die," the serpent said to the woman. "For God knows that when you eat of it your eyes will be opened, and you will be like God, knowing good and evil.
Well, we know good and evil now, and we also die now. Adam can be tricked by satan because thats satan's job, to try and trick people. Thats what he was created for.
We aren't being punished, as you say, its the natural consequence of introducing something new into the equation. It doesn't mean that its not G-d's will or that we somehow were forsaken by him because of this, it just changed things, and was probably intended from the beginning, because as you point out, he knows everything.
So then, whats our purpose? To finish creation. We do that by healing the world, and we can't heal the world without a good and evil inclination, because we wouldn't grow without them.
Just like you have to test yourself physically as an athlete, the spiritual person also has tests that the almighty will present him to force him to grow and come closer to him.
I think this probably helps to put that story into a light where it might make more sense to you.