My position regarding the purpose of existence of the universe (including the origin and problem of evil, of course) consists in analysing the amount of explanations we have about it. Basically there are 4 metaphysical explanations I find them very interesting and sums up the reasonings of humans about cosmogony.
The first one is found in the Vedas and Upanishads. Hinduism explains that the ultimate realist is Brahmam (not Brahma). Brahmam is perceived by some as a personal entity (God) and by others as a reality. Everything comes directly from Brahmam so everything is part of Brahmam. The evil in this cosmogony is the illusion of not being part of Brahmam. So the purpose in life is to be free from this illusion (Moksha).
The second one is from Buddhism that says the ultimate reality is Sunyata. Sunyata is a kind of "pregnant void". Buddhism defines as a total mystery why there's something else instead of just Sunyata. They're concerned in stopping the suffering produced by the illusion of separation from Sunyata. Sunyata allows the existence of a very quintessential existence without the Three Marks of Existence. They call this "existence" as Buddha nature. Evil is perceived quite the same as in Hinduism. Buddhism is very complex but IMHO is a kind of mystical Nihilism.
The Greeks (and Romans) believed that there was always a kind of special matter. This quintessential matter is personified as Chaos (by Ovid). Chaos sometimes is referred as a God and sometimes as a place or reality. Chaos created all the things from itself. There's no concept of void in this theology. That's why Romans didn't used the concept of zero (there's no zero in Roman numerals).
In Catholicism there's a mentality to embrace everything known by man.
The term comes from a combination of Greek words Kata (concerning) and Holos (totality, university, etc).
The opposite of this mentality is Heresy. Heresy comes from a word meaning preference, chosen things. In Heresy you just accept things that you pick and choose.
The Catholic cosmogony starts with God being the only reality.
At some point God first creates a reality separated from himself. God there's no potencial to be fulfilled so He created a "reality" with infinite potency to be fulfilled. God first creation is the Nihilo. In JWism there's a logical problem of Jesus being the first creation of Jehovah. If Jesus was the first creation, Jehovah created Jesus from himself and by consequence Jesus would be just a person "inside" Jehovah. The logical conclusion of JWism is they believe in a kind of "binity". I'm an atheist regarding this JW definition of God.
The Nihil is the first sphere of reality surrounding God. This is the Christian Nihilism. Is an abyss or chasm that only God can trespass. Like a black hole that traps even light, we can think of Nihilo as being capable to trap black holes. This reality was created directly by God to be the exact opposite of Him. Is a lack of God state or reality. But it cannot sustain itself so it must be sustained by God.
From this point, God creates everything from this void. The first Creatio Ex Nihilo is the pure spirits. They were created in fixed spheres of existence. Their existences are fixed in their spheres in relation to a concept called Glory. Glory is heuristically defined as how much close you are from God (Grace can be used in this definition too). The opposite of this measure is Sin or Fall (how far you're from God). These ranks of pure spirits is defined by Angelology. Michael the Archangel is a pure spirit who was directly elevated in Glory by God after defeating Satan (who was in a higher rank). Animals are fixed in Glory too.
After God created (Ex Nihilo) the material universe and set natural laws to this reality (Big Bang). By evolution life aroused and humans appeared. This is the Christian Materialism.
In a recent point in human history God directly created the first soul in a human. From this point God directly creates the souls in the offspring of this particular human (Adam). The human soul is immortal because it is Created Ex Nihilo.
So in Catholic theology God directly created the Nihil, the Pure Spirits, the Big Bang and every Human Soul. Because these are direct creations they are substantially perfect and cannot be destroyed or perish without God's will. But the existence of all these direct creations need to be sustained by God.
How evil fits and was created in this theology?
The most accepted tradition in Catholicism is this:
In some point God revealed to Pure Spirits that the Human Soul would fall from its purpose and it would be redeemed by God Itself.
And the plan of Redemption will be God becoming a human being to save humankind.
At this point a highly rank Pure Spirit rebelled against this God's will. He simply could not accept the implication of worship a human and "worse" God would have a human body from that point. The human nature would cross the Nihil and enter in the very nature of God. He said that if God wanted to be humiliated and wanted to take a nature from His creation in this plan He could better become an angel but not a human. Indeed Mary achieved the highest rank in Heavens, a human being the most close creature from God.
Humans face a similar situation in the doctrine of Eucharist (explained by Aquinas using the Aristotle's theory of substance).
Then for the first time the possibility of evil was used (like the possibility of jumping from a balcony in a building). This Pure Spirit could not support to live in a reality where God would have a human body. So he jumped in the only reality accepted for him. He jumped into the Nihil. He made a Columbus' Egg doing that and other Pure Spirits followed him and later other humans too. Now Satan could be in the highest rank far from God and not be fixed in position of achievement. And he's very good in digging more and more.
Like is said in Latin: Corruptio Optimi Pessima (the corruption of the best is the worst of all).
This is the metaphysical explanation that I accept for the origin of evil.