Q. Why did God allow Adam and Eve to eat of the fruit of the tree of the knowledge of good and evil?
A. Another way to state your question is this: Why did God make human beings with a free will, even though He knew they would abuse it?
Which is better: A world of robots who act only in accordance with God’s will because they are programmed to do so? Or a world of sons and daughters, made in His own image, who are free to love Him and one another, even if they sometimes fail to do so? I think that most of us would agree with God’s decision that the latter is the better kind of world, despite its problems.
As long as there exists in the world a free will other than God’s own, there exists the possibility of that will opposing His will, at least at the outset. (A human free will that chooses to love God is at last, after death, confirmed in that choice so that it can never choose against God again; but the final “ratification” of the will’s choice by God results from the will’s own free choice in the first place.)
God was willing to allow for free human (and angelic) wills to oppose Him because free-willed creatures are a much higher good than robots. But keep in mind as well that God is able to bring out of even the greatest of evils a greater good (see Romans 8:28).
Because He has this ability (which He continually exercises), He is justified in allowing the evil. In the end, though we may not be able to see it clearly now, His Providence crafts a universe in which, as St. Paul says, “this slight momentary affliction is preparing for us an eternal weight of glory beyond all comparison” (2 Corinthians 4:17).