The problem of good and evil is one that has perplexed philosophers and theologians for thousands of years. As far as we can tell, only humans are afflicted with the knowledge of good and evil. According to some, the appearance of good and evil is an illusion. Others insist that it is fundamental to our spiritual purpose as human beings. In a sense, they are both correct.
To understand how both statements can be true, we have to first establish a valid hierarchy of the real. The only thing in existence that is unequivocally real is consciousness, the "mind of God" if you like. Consciousness itself, is a unity, and therefore unmanifested. All manifestation, material and otherwise, is contained within it. In order for this consciousness to know itself, or have any experience whatsoever, it has to project a reflection. This is the root and purpose of all duality. It isn't difficult to realise the truth of this for oneself. Just pick any duality and try to conceive of one half in the absence of the other. It can't be done. "Up" has no meaning without "down". "Hot" is defined by "cold", etc..
Since duality is a precondition of knowledge, it logically follows that there is something to know. This "something" would have to exist in potentiality within the original unity of consciousness. It would be a true thing, but could only be known by means of duality. For example, if I were to present you with a white piece of paper, bearing an image of some kind that was also white, you wouldn't be able to see the image. You'd just have to take my word for it, because the image (foreground) would be indistinguishable from the background. So, in order for consciousness to know it's own true nature, it projects a reflection. The original reflection is what we call "the Light", or goodness. Now there exists a subject (consciousness) and an object (Light).
Visual metaphor: If I am standing next to a light source, I will cast a shadow. Also, the nearer I am to that light source, the bigger the shadow will become. But what if I am the light source? Then, the light still exists, but the shadow is no more. The shadow exists only for the sake of contrast. It is not real in the same sense as that which it reveals. As I understand it, goodness is a true thing and evil is it's absence. The first is a reflection, and the latter, a shadow of a reflection. They are both illusion in the absolute sense, but they allow for the knowledge of something real. Spiritual judgement, or discernment, is the ability to know the difference.
Judgement is a word with two distinct meanings. In one sense, it means the ability to distinguish between Truth and illusion. In the other sense, it refers to the acceptance or non-acceptance of what IS. These two meanings could hardly be more different. The first is our spiritual inheritance as centres of self-reflective consciousness; the second is a trap generated by the false ego. It is an error, (the real translation of the word, "sin"). When the character of Jesus made the statement, "Judge not, lest ye be judged." He was referring to this second meaning. Most organised religions (particularly the book-based ones) have deliberately confused these definitions. For the sake of clarity, I will henceforth be using the word "discernment" for the first definition and "judgement" in the second sense only.
We, as centres of consciousness, have the innate ability of discern the difference between the Light and the darkness. It's called a conscience. In my opinion, the biggest and most destructive lie perpetrated by the religions is their insistence that we do not have this ability, and must therefore have it taught to us (by them of course). Seriously? Do you really think you need to be told that torturing children or defiling the Earth is evil? You know. The only way you wouldn't know this, is if you had been brainwashed into believing that your own spiritual discernment is not to be trusted. If you had been so brainwashed, you'd be well and truly screwed. You could then be made to believe, for example, that burning people alive, or cutting pieces of flesh from babies (circumcision) is good. Another version of the same lie has been foisted on non-religious folk: the law. Society teaches us that we must have laws or we wouldn't know how to behave ourselves. I call bullshit on that. Anyone who believes they need laws to know the difference between right and wrong in the moral sense, is just as screwed as the fundies. You'd have no trouble convincing such a person that things like preemptive war and the implementation of a totalitarian police state are right and proper. It's the law! Such people are also liable to believe that anything that isn't illegal is OK. It's not illegal to be cruel to others, to betray their trust, or to take unfair advantage of them, (except by narrow legal definition). There just aren't enough laws in the world to replace a functioning conscience; nor could there be; nor should there be.
Both religion and the law implicitly assume that reward and punishment are needed to motivate us to goodness and save us from our innately evil nature. As if naked, egoic self-interest could ever lead to truth or love. I do not embrace the Light for the sake of some future reward; I do it because uplifts my heart. I do not renounce darkness out of fear of hell-fire or prison, but because it is repulsive to my spirit. Spiritual Truth matters to me, not good or bad karma. This would not change even if the fundies are right and I am destined for hell.
Some have said that the knowledge of good and evil is a curse because it leads to judgement. The way I see it, judgement is a misuse of this knowledge. The ability to discern the difference between darkness and Light is for ourselves alone. The perception of the Light's beauty draws us toward union with Truth. The exposure to darkness pushes us towards Truth from the opposite direction. As in the visual metaphor above, the closer we come to the source of Light, the bigger and darker the shadow appears. Only union with the Light can negate the darkness. Any attempt to fight the shadow directly is futile. Such attempts only serve to give the darkness more energy. Better to simply recognise and renounce it. The darkness is merely the shadow of a reflection of what is. It never was real. It's hard though, when seeing it, to avoid being mesmerised, caught like a deer in a car's head-lights, weeping buckets and judging what is. Should we then refuse to look at it, as some new age philosophers suggest? I think not. Observing darkness is necessary, in that it allows us to know truth by contrast. If you are afraid to look at it, you cannot truly know the Light. The perception of both polarities allows us to choose for ourselves what we will be. It isn't really a choice in the end though, since no one who has truly known the Light could refuse it. I can't make the choice for anyone but myself. Judging others is the false ego's way of avoiding the real issue (knowing Truth) and diverting our attention from it. Those "others" may be centres of consciousness from their own perspective, (or maybe not) but as far I'm concerned, they are only reflections. If I were possessed of perfect knowledge of the Light, their darkness would not exist for me. If I were totally conscious of my oneness with the Light, I would not cast a shadow.
Unless you believe that the consciousness that created everything is inherently flawed or doesn't exist at all, it follows that the appearance of evil serves that consciousness somehow. It will exist for as long as it has to. Ultimately, it is up to each of us to decide how long that will be.