And God knew this would happen, that Adam would fall, didn’t He?
Yes, God knew it would happen.
You are tapping on the window of “the problem of evil.” There have been countless sermons, Bible studies, and books on the subject.
God can stop evil. Why doesn’t He? God could have prevented the Fall. Why didn’t He?
There is probably not enough bandwidth on FR for me to address the topic, but it is addressed to a large degree in Romans chapter 9.
I will conclude by saying that while God did not prevent all evil, He prevents a whole lot of it. Also, He provided a way out at immeasurable personal price.
I recommend an inexpensive book. “God and Evil, the Problem Solved” by Gordon H. Clark. It is about five bucks and is an in depth, biblical examination of the question.
Felix culpa. Google it.