Balder said:A moral problem is posed by perfect and absolute "foreknowledge." If God knew what Satan was going to do before ever making him, meaning he perfectly foreknew the problems he would cause and the eternal suffering he would have to endure, and God made him anyway, would God bear any moral responsibility? Think of it this way: If you and your spouse were planning on conceiving a baby, and an angel came and told you that if you attempted to conceive this evening you would be successful, but the baby you produced would freely make some disastrous choices that would hurt many people and lead to her own eternal and inescapable torment, would you go through with conceiving her?
I am not sure that God would bear "moral responsibility," but it would seem that both in the heavenly realm and the earthly one, that He did create the conditions for evil to exist, and, yes I do believe that He foreknew this. I think that the reason He did this was as a means of instructing people, by contrast, as to the nature of God and motivating those who would to come to Him.
I am sure there are better answers than this, but this is all that has been offered thus far.