All good questions rgp. God did not want to create Robots. He wanted us to choose on our own to Love and Obey Him just as an earthly father wants from his children. He wanted us to have a relationship with Him. So he created us to make our own choices between Good and Evil (devil and temptation).
Unfortunately, man chose the devil's tempting offer to eat from the tree of knowledge which God said not to. Thus the Old Testament is riddled with sinful atrocities and God's harsh discipline as He tried to get mankind to choose Good over Evil...to love and obey Him. Yes, God could have just made Man to be be good but that would just make them robots. He finally, in the New Testament, instead of punishment He offered forgiveness to all who believe along with teachings of love and obedience...also kindness, patience, joy, faithfulness, gratitude, and peace