“Rule over sin” was God’s first moral command to men. When Cain became angry after God preferred Abel’s offering to his, God said to him, “If you do well, will you not be accepted? And if you do not do well, sin is crouching at the door. Its desire is for you, but you must rule over it.” Obviously, Cain did not do well, for immediately after hearing this command, he lured Abel to the field and murdered him. Mankind has followed in the way of Cain ever since. By the tenth generation men were so evil that God determined to destroy all of mankind except for Noah and his family. Until that time only two men had been singled out as faithful among men, Noah and seventh generation Enoch.
By the 500th year of Noah’s life “the Lord saw that the wickedness of man was great in the earth, and that every intention of the thoughts of his heart was only evil continually.” (Gen. 6:5) Only Enoch and Noah were said to have “walked with God.” (Gen. 5:24, 6:9) Only they did not turn aside from Him to walk in the way of evil. The first man and woman had eaten of the Tree of the Knowledge of Good and Evil. Ten generations of men showed that almost all men chose evil rather than good. Since almost all chose evil, “the Lord was sorry that he had made man on the earth, and it grieved him to his heart.” (Gen. 6:6)
So, was God surprised by this choice? If he knows the end from the beginning, and Scripture affirms that he does, then he knew man would choose evil over good. Yet, he still created him and he certainly intended him to eat of the forbidden tree. He also knew from the beginning that he would destroy the tenth generation in a catastrophic flood. Did he then cast all these miserable sinners into an eternal Hell to be tormented forever for choosing evil?
No, for in the fullness of time, according to 1 Peter 3:18-20, Jesus went to these prisoners and preached. What did he preach? A few verses later Peter tells us that Jesus preached “the gospel” to them! Why? “So that they might be judged according to men in the flesh, but live according to God in the spirit.” (1 Peter 4:6) Jesus went to the dead and preached salvation through him to them. He did not go there to chastise them so that they could ponder their misery forever. No, he preached the gospel to them so that they could repent of their sins and begin to apprehend the way and truth of God. He did not leave them in an “eternal Hell” or an “eternal torment.” They had already had their part in this “outer darkness” and he went to bring their release, to make “captivity captive” to him.
Why does the Scripture say that God was sorry he had made men? In order to show men that their way of evil is not His way. He let men go in the way they had chosen in order to show them that the way of evil does not bear fruit and does not bring happiness. It brings destruction. Rather than programming man to do only good, God gave man a freedom of will by which he could choose to do evil or good. He implemented a plan by which he would, slowly but surely, train mankind to love the good and despise the evil. He was grieved when all humanity but one chose evil, but he knew from the beginning this would happen and that it would be grievous. God knew that it would take time for his creation to bear fruit, for man to grow into his likeness. And today we do see many more than one walking with God and choosing good instead of evil.
This explains why God allows and, in fact, even created evil. If evil did not exist, then men could not learn to eschew it. Without evil, good has no intrinsic value. Good would simply be the way things are and always were. Man could never truly be “like” God if he did not know the distinction of good and evil. (This also shows that God could be evil if he wanted to be, but he does not want to be so) If God had created a world in which only good existed and only good could be done, then mankind would never have had or developed a free will. In this respect also he could never have been like God.
Man’s eating of the Tree of the Knowledge of Good and Evil “opened” his eyes so that he knew there existed two opposing principles, the principles of good and evil. God’s act of creating man in His image included the eating of this tree. God then used the subsequent and unfolding release of evil to train his creation to discern between good and evil and to choose the good. We catch a glimpse of God’s ultimate goal concerning his creation in 1 John 3:2-3 (ESV), “Beloved, we are God’s children now, and what we will be has not yet appeared; but we know that when he appears we will be like him, because we shall see him as he is.  And everyone who thus hopes in him purifies himself as he is pure.” When God told Cain to rule over sin he advised him to choose good instead of evil, to be pure, even as God is pure. The same command applies to all of us today.