To some people, the creation of the Tree of Knowledge reveals God as anything from criminally negligent to flat out evil. Knowing full well Adam and Eve would eat from the tree, as well as the effects it would have, even being fully capable of stopping them, God nevertheless chose to create the tree and turn His back. Was this God being careless? Was this divine entrapment? Was this, as one atheist I debated put it, the equivalent of giving a child a hand grenade and simply saying "don't pull the pin"?
The answers to these questions, while complex, do have a "simple version". To begin with, it's interesting to note that the tree itself is not important. According to Paul in Romans 5:13, sin already existed before the law, but sin is not imputed where there is no law. At its root, all sin is the same. It’s a disobedience towards God, or at least the desire to do so. But you can’t disobey a command that was never given.
Think of it this way: in today’s society, rising crime rates is a huge concern. We all want crime to go down, and there are several ways of doing that. One way to eliminate the crime rate would be to completely eradicate all laws and disband the government. With no laws to break, the crime rate would instantly drop to 0. But this "solution" is obviously unacceptable. It wouldn’t solve the problem, it would simply shift it. The correct way to handle crime is to make laws, prosecute those who break those laws, and attempt to prevent the mentality that would cause one to break them in the first place.
In the same way, God could have given mankind no way to rebel against Him by simply never giving us any commands. But this doesn't actually solve the problem of sin. Like a nation without laws, all it would do is create a world of spiritual anarchy, run by a God with all authority, but doesn't use it. This God would command the wind, the waves, the sun, the moon, the stars, even the very ground we walk on, yet His own image bearers, being immortal, would never come under His control.
This would certainly solve the problem of death, but even death solves a bigger problem: Sin. By making laws such as "do not eat from the Tree of Knowledge", God didn't set us up to fail, but to become accountable for our failure. But this was always His plan. He knew we would fail, but He also knew He would succeed, and of course from His success, He can bring us to a far more glorious world than we had even in Eden. Therefore, rather than being an example of divine entrapment, the Tree of Knowledge is a semi-inconsequential step in God's unfathomably great plan.