The tree of knowledge of good and evil didn't give mankind a moral compass. We already had that as part of our innate nature from God. It's called the tree of knowledge of good and evil retroactively by mankind, because when we broke God's commandment, we experienced firsthand the reality of evil--its darkness, its corruption, the death and suffering that it brings.
St. John Chrysostom says about the Fall in his Homily 16 on Genesis:
Since, however, he was guilty of great inadvertence and together with his wife fell into this disaster through transgression of the command given him by tasting of the tree, accordingly called it the tree of the knowledge of good and evil--not because he was ignorant of good and evil before this (he was, after all, not so ignorant, since his wife was in conversation with the serpent and said "God said, 'Do not eat of this lest you die,'" so that he knew death was the penalty for breaking the command), but because after eating it they were divested of the glory from above and also had experience of their obvious nakedness. This was the reason it was called the knowledge of good and evil, since in connection with it there took place the contest, as you might say, between obedience and disobedience.
Have you discovered why it said, "Their eyes were opened, and they realised they were naked"? Do you know why the tree is called the knowledge of good and evil? Consider, after all, how much shame they were eventually seized with after eating it and thus breaking the Lord's command: "They stitched fig leaves together, and made themselves skirts." See the depths of indignity into which they fell from a condition of such great glory. Those who previously passed their life like angels on earth contrive covering for themselves out of fig leaves. Such is the evil that sin is: not only does it deprive us of grace from above, but it also casts us into deep shame and abjection, strips us of goods already belonging to us, and deprives us of all confidence.
God wasn't trying to keep us as dumb robots. He forbade mankind to eat from one ordinary tree, out of dozens or perhaps even hundreds or thousands of other trees, in order to teach Adam that God is the Lord over all creation, and not mankind.