Often I read people who wonder why God made humanity if he knew they would disobey. Augustine provides this answer:

“If someone asks, therefore, why God allowed man to be tempted when he foreknew that man would yield to the tempter, I cannot sound the depths of divine wisdom, and I confess that the solution is far beyond my powers. There may be a hidden reason, made known only to those who are better and holier than I, not because of the merits but simply by the grace of God. But insofar as God gave me the ability to understand or allows me to speak, I do not think that a man would deserve great praise if he had been able to live the good life for the simple reason that nobody tempted him to live a bad one.”

Augustine, On the Literal Interpretation of Genesis II.4.6. in Andrew Louth (ed), Ancient Christian Commentary on Scripture, Old Testament I: Genesis 1-11. p. 80

It sounds like the modern “if God made robots then there would be no real love between God and creation”.