A more complete version of this question typically sounds somewhat like this:
“If God, who knows the future, knew that humans would make such a mess of life on this planet, why did He create humans in the first place?”
Indeed, the first two humans God created soon fell into disobedience. One of their first two children murdered the other one! The history of mankind, for the most part, seems to tell a story of humans rejecting God and going their own way. Why would God create these beings with freedom to disobey and reject His perfect plan for them?
Coming from another direction, the question is sometimes asked this way:
“For what purpose did God create people?”
Was God just bored and wanted some new excitement, or was God lonely or wanted to satisfy some hidden need?
If we put the two questions together we get, “For what purpose did God create people who had the freedom to choose to disobey Him?” Why didn’t He just create things with no downside risk?
Maybe we should ask ourselves these questions Why do we choose to marry someone who doesn’t really have to always love and obey? And why do we choose to have children (pro-create new people), who just like mom and dad, can’t be forced or programmed to always love and obey?
Now look what we’ve done. We’ve taken one basic question and multiplied it into several. But hopefully, this approach will be productive in the end as we think this through.