From “How to become a Christian”: Chapter 6 – The bad news first – sin and its consequences.
One might ask why God allowed Adam and Eve to sin, given the terrible consequences it had for them and everyone since, including us. However, there was no alternative. Remember that God wants human beings to relate to Him freely and to voluntarily love, honour, obey and worship Him. He created us in order to do those things freely, not automatically, or by compulsion.
The big problem that God had was that, above all, He wanted us to be completely free, with genuine freedom of choice and free will. That has major implications. If men and women are to be truly free to choose to obey God, then that can only mean anything if they are equally free to choose not to. If God had created us with no option but to obey Him, then we would be reduced to mere toys for God to play with. Our love and worship towards Him would mean nothing.
You can ponder on that for as long as you wish, but you will not be able to find a way round it. If God cannot do so, then you cannot. It was of paramount importance to God that we be genuinely free. He therefore had to accept the consequence. That was that Adam and Eve, and all of us, would fail that test and would deliberately choose to disobey Him.