Why did God put a forbidden tree in the Garden of Eden?
Some people use this as an argument against God's goodness. But it's actually just the opposite.
Think about it:
God gave Adam and Eve one rule (Genesis 2:16-17). Just one.
They had a plethora of choices for delicious, nutritious fruit (Genesis 2:8-9) and only one was forbidden. Just one.
God created Adam and Eve "very good" (Genesis 1:31) and had fellowship with them (Genesis 3:8-9) so they had no reason for insecurities, concerns, or fears. None. Not one.
But God didn't want robot love anymore than you or I would want it.(1)
So He tested their faith.
And man, without a care in a perfect environment, with every reason to trust and obey his loving Father, sinned at the first opportunity, broke the one rule, and broke God's heart.
This event is not an argument against God's goodness, but an argument for it...especially because God immediately began to redeem mankind from his sins.(2)
(1) See "Why Did God Create Man With the Ability to Sin?"
(2) See "Things that Make Me Sad About Adam."