He said that while God created all good, he allowed the Devil to do is evil. So the Devil did. However, because God was the creator of everything, including the Devil, the Devil could not defeat God nor destroy the kingdom of Christ.
The Devil chose to reject God and His good, and he chose to tempt the first man and woman to walk away from God and toward sin. Adam and Eve were also given the right to choose, because what fun would it be to live in a world where you had no way to make it better. So the Devil decided that he would tempt them.
Genisis said that God told the first humans not to eat from the tree of knowledge, and this was his way of saying that they must accept God's laws which tell us what is good and what is evil. But the first human beings disobeyed God's command. Seduced by the devil, they preferred themselves to God, thinking they could thereby be like God.
Instead, their sin brought tragic consequences. Satan gave them a false image of God as one who was jealous to keep power from them. They became afraid of God. They lost the soul's control over their body, the accord between man and woman, harmony from creation, and freedom from death.
Sin flooded the world and has affected all of history. It has affected us, for we are drawn toward what is wrong and trapped by evils which cannot come from God. This can be unerstood only in connection with the sin of our first parents.
Because of their sin, our first parents transmitted a human nature deprived of holiness and justice, a state known as original sin. Original sin does not wholly corrupt human nature. But id does deprive us of original holiness and weakens our natural powers. It subjects us to ignorance, suffering, and death. It gives us an inclination toward sin called concupiscence. As a result, we must struggle with sin. We are tempted by Satan and negatively influenced by sinful sinful situations in society.So while everything God created was good, including angels and humans, he gave us the right to accept or reject his laws. Yet when one angel rejected God, he became the devil and created sin and hell. Hell is one of the biggest deterrents for those who believe in God's laws from sinning.