God did two things in the Garden of Eden that may make it seem like He set mankind up for failure:
If God wanted mankind to prosper, why even make the tree? And why, after making the tree, would He allow Satan to tempt Eve, knowing that it would have an effect on her?
In the story, it's easy to get fixated on the tree. The tree doesn't matter. It could have been anything that God told them not to do. God simply chose to make the act of rebellion eating fruit from a tree.
Adam and Eve, before the fall, only had this single commandment that they had to worry about keeping. Beyond this, they were in a state of innocence. Their entire concept of right and wrong consisted of doing literally anything they wanted to do, or breaking that single commandment. So, forgetting the tree, we can look at the fact that God was giving mankind the choice to either obey Him, or disobey.
There is no indication that the Tree of the Knowledge of Good and Evil would have been there forever. Eventually, after so much obedience, God may have taken the tree away. We don't know that for sure. However, God found giving mankind a choice, at least for awhile, a compelling enough proposition to do so, even if it would have potentially detrimental consequences. What does this tell us about God?
It tells us that God is interested in a creation that wants to be with Him, and wants to obey Him. He uses choice to parse the creation into two groups - those who want to be with Him, and those who don't. All those who want to be with Him, will end up with Him (Matthew 7:7-8, Luke 11:9-10, Hebrews 11:6, Deuteronomy 4:29, Psalm 9:10, Proverbs 8:17, Acts 17:26-27: 1 Chronicles 28:9, Romans 2:5-8, John 7:16-17), and all those who don't, will not.
The tree doesn't matter, because every single person has their own personal "Tree of Knowledge" to contend with. For us, that is the choice of whether to believe in Christ, or not. If you believe, you choose God. If you don't, you reject God (John 3:36).
The above gives us some insight into Satan's role in this creation. Satan was certainly allowed to tempt Eve, but going a bit further back, we need to discuss why God allows Satan to exist at all. Why not destroy him the moment he rebelled (Ezekiel 28:12-19)?
As discussed in the article Why Does God Allow the Devil to Exist, Satan's relationship with God is ultimately that of a tool to accomplish His own ends. In this case in the Garden of Eden, Satan was allowed to tempt Eve, because God wanted Eve to prove whether she would choose Him or not, when in the presence of a being telling her not to.
So, in conjunction with providing Adam and Eve with a choice to rebel or obey with the Tree of Knowledge, Satan was used by God to further make that choice meaningful, and further test His creation. By allowing this evil being to operate, and tempt, God gives humanity more choice as to whom they want to serve, and more opportunities to prove their faith and allegiance.
And, as discussed in the aforementioned article, Satan is not impossible to overcome. Resisting him is further evidence that someone wants to be with God, which is of course pleasing to Him.
In summary, what we can learn from this story is how much God values our choice. The fact that God did not make automatons, or a situation without potential for rebellion, tells us a lot about His nature, the purpose of our present situation, and the kinds of beings He wants to spend forever with.