God wanted to have a relationship with man
In order for this to occure, He had to give man the OPTION of desiring a relationship with god (you can not relate to a robot, it does whatever you want with no questions asked. No one in the history of mechanical robots have ever had a true agape relationship with that robot. He may LOVE what it provides (selfish love) but he does not LOVE it as a being (wishing only to serve the object of his love
For this reason, God had to allow man the opportunity to love and receive Gods love willingly. But also the opportunity to deny and not receive Gods love, and do for themself. (This is the free will conundrum) failure to allow us the opportunity to say no would in reality make us robots, not relational being, which God is,, hence he made us in his image. (Able to chose)
Does this mean Adam and Eve was not created perfect? I do not think so. They were created perfect in all ways. It was not Gods mistake or imperfection that caused them to sin, it was the free will God gave to them which caused them to fall
More amazingly is god, in all his infinite wisdom, KNEW man would rebel. So he also made a plan of salvation. This plan, as a byproduct, would also destroy the lie of satan that God is not a god of love, but a God of evil who makes us his robots demanding we do all he wants, and does not have any desire to take care of our needs. That plan was the cross. And he himself coming to take out penalty on himself.