Adam and Eve had sinned against God. God told them that they could eat of any tree throughout the entire garden but warned them not to eat of the tree of the knowledge of good and evil (Genesis 2:16-17). Some time later, Satan showed up and asked “Did God really say you must not eat the fruit from any of the trees in the garden?”(Genesis 3:1), Eve responded “Of course we may eat fruit from the trees in the garden, It’s only the fruit from the tree in the middle of the garden that we are not allowed to eat. God said, ‘You must not eat it or even touch it; if you do, you will die.’” (Genesis 3:2). God had warned Adam and Eve earlier not to eat the fruit from that tree. Satan told her that they wouldn’t die, and that God told them not to eat the fruit of the tree because God didn’t want them to become divine and have special knowledge like He does. In other words, God was holding out on them (Genesis 3:4-5).
Adam and Eve gave into the temptation (Genesis 3:6-7), and God pronounced some curses upon them. Life was no longer going to be super easy like it had been. Now, life would be harder (see Genesis 3:13-19). Skeptics have ridiculed this account not just because taking Genesis 1-11 as historical contradicts Darwinian evolution (of which there’s no good reason to accept as true and every reason to accept as false) but also due to the nature of Adam and Eve’s sin. They ate a fruit. Yes, they ate a piece of fruit. So what? Why would God both forbid them from eating from a particular tree and then get so angry at them for eating from it? It seems like such a silly thing to get angry over, doesn't it? Does God’s reaction really make sense?
For one, this was a test of their free will. As I’ve explained in prior writings, God has given free will to choose between good and evil, right and wrong, sin and salvation. He did this because He wanted human beings to love both Him and each other (see Matthew 22:37-39, Mark 12:30-31, Luke 10:27). Without free will, love is impossible. A personal relationship, characterized by the possibility of love, is only possible if created beings are given free will. If God had created the universe with no possibility of evil or sin, then the created beings would have had no free will, and, as such, would essentially be programmed computers. Such beings would be incapable of love, since love involves making a choice - which requires the ability to choose not to love. For example, I can program my computer to say "I love you" when it starts up. Does this mean that the computer really loves me? No. Likewise, God could programmed humans to say that they loved Him, without the possibility of rejecting Him or performing evil deeds. However, these programmed beings would exhibit about as much true love as my computer - not a very satisfying relationship. Therefore, God created the universe for the express purpose of allowing free will spiritual beings the opportunity to have fellowship with Him (and likewise, reject Him). The Tree Of The Knowledge Of Good and Evil was one such opportunity for His humans to reject or serve Him.
God did not get ticked off because they had eaten a type of fruit, he was angry because their action was a symbol; it was a sign of rebellion, of sin, of rejection of God’s holiness.
As Richard Deem of GodandScience.org writes “Skeptics often complain that God set Adam and Eve up to fail. However, God had to give Adam and Eve a choice. Without free will to choose, Adam and Eve would have been mere puppets. True love always requires choice. God wanted Adam and Eve to choose to love and trust Him. The only way to give this choice would have been to command something that was not allowed. Since God had planted in the garden all the different trees from which we now get fruit,1 the test was not too difficult. Adam and Eve had plenty to eat and a large variety of fruits from which to choose, and could have chosen to believe God. They were only commanded not to eat from one tree out of the many.”from the article “Why Wouldn’t God Want Adam and Eve To Have The Knowledge Of Good and Evil?”
GotQuestions.org writes “God gave Adam and Eve only one prohibition in His instructions. Whether there was some spiritual property within the fruit is really irrelevant. The sin was in disobeying God's command. By eating the fruit (an act of disobedience), Adam and Eve gained personal knowledge of evil. They already knew good, but now they had the contrasting experience of the evil of disobedience and the guilt and shame that came with it. Satan's lie was that knowing good and evil would make them like gods (Genesis 3:5). In reality, they were already made in the image of God and had the blessing of His good pleasure.”
By choosing to go against God’s command, they demonstrated that they were making their choice. They chose Satan’s side over Gods. They exalted their own wills over God’s. They spat in the face of the Maximally Great Being. God did not have to forbid eating the fruit of the tree of the knowledge of good and evil. God could have chosen some other thing to prohibit Adam and Eve to prohibit doing. It just so happened that this tree provided an adequate test of Adam and Eve’s loyalty and they failed that test, sadly. This was the only commandment that they had been given at this point and they blew it!