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...