God did not create the evil. He established the laws which are always good because he is good. The spirits would have been completely happy had they faithfully observed the law since the beginning. But, being free to make choices, the spirits have not properly obeyed them so that evil come as a consequence of this unwillingness. One can then say that good corresponds to everything which is in accordance with God's law while evil is everything which opposes it.
Allan KardecJust as Christ said: I am not come to destroy the Law, but to fulfill it, so Spiritism says: We have not come to destroy the Christian Law, but to carry it out... Spiritism has come at the predicted time to fulfill what Christ announced and to prepare for the achievement of future things. It is then, the work of Christ, Who, as He also announced, presides over the regeneration which is now taking place and which will prepare the reign of the Kingdom of God here on Earth.
Allan KardecIn order to cooperate in the material worlds as agents of a divine power, the spirits temporarily have a material body. By the work required in their corporeal lives, the spirits improve their intelligence and, by observing God's law, they acquire the merits which will lead them to eternal happiness.
Allan KardecGod leaves to our conscience the choice of the road we decide to follow, and the liberty of yielding to one or another of the opposing influences that act upon us.
Allan KardecThe incarnation was not initially imposed on the spirits as a punishment. It is rather necessary for the spirits' improvement and for the fulfillment of God's works. Everyone has to submit to it, no matter if one takes the evil or the good path. Only those who take the good path will improve quickly, they do not delay to arrive at the end in less painful conditions.
Allan Kardec