יוצר אור ובורא חשך, עשה שלום ובורה רע; אני יהוה, עשה כל-אלה
Form light and create darkness, make peace and create evil; I Hashem, do all these.
This verse makes it clear that evil cannot exist independent of human beings, endowed with free will, and made in the image of the Divine. Human beings are responsible for all evil.
The word used for “I’, in this verse is ani אני – the same word a human being uses to say “I”. Consequently, evil is only created within the context of an “I”; that is, a human being. Further, evil does not exist except within the context of an “I”, who as a human being made in the image of the Divine, misuses his or her free will (bechirah chofshit בחירה חופשית) as an agent of the Divine.
Supporting the idea that misuse of human free will constitutes the origin of evil is also the fact that the word used for “I” in this verse is ani אני in contradistinction to another word for “I” which could have been used, anochi אנכי. Anochi contains the letter kaf כ, symbolic of keter and the soul power ratzon, will. Ani lacks the כ, and thus, lacks “the sign” indicating an ability to properly exercise free will (which the presence of the letter would suggest as it does for anochi).
Taking all this together, I propose that evil was not created to give humankind the ability to make freewill choices. On the contrary, I think that evil was and is still created in direct consequence to the failure of humankind to exercise freewill properly.
The existence of evil is not required for freewill to exist. On the other hand, the existence of freewill is required for evil to exist.
 Also, “ani” is the I-form from which evil can be created. “Anochi” is the I-form which creates “all good”. Interestingly, “anochi” is an Egyptian word.