God gave man and angels a freedom of choice. they could do good or evil.
one third of the angels rebelled against God. they are the demon spirits we have to deal with.
Adam and Eve, who were given authority over this earth, obeyed satan and ate from the tree of the knowledge of good and evil. now having that knowledge they are now accountable for their actions, having good and evil consequences.
thats how sin entered into the world.
sin brought about sickness and all the other curses of the Law in Dt 28.
so God is good. .. good enough to give his beings a freedom of choice. and since theres the freedom of choice, theres also evil in the world.