Good and evil are human nature.
It could have all started in a cave. You know, trying to stay alive.
Tribe survives = good
Tribe wiped out = bad
I'm not sure how we got from that to 'masturbation will weaken you spiritually' and believing that the Gnostic Gospels is heretical.
Caves are responsible for lots of mad religious ideas. We should treat them with great respect, not just because of what happened in Thailand. In pre-history or thereabouts, caves were the entrance to the other world. Later, louts like Mohammad would use the cave called Hira on a mountain near Mecca to symbolise a connection with God.
Good and evil are about desire and desire is about lack of what is desired, achieving one's desire does not end our desiring, we desire until we die. The differentiation of what is good and what is evil has to do with our societal codes of conduct. We always desire what is good/pleasurable for us, even if we know that a particular desire is culturally evil . What's culturally evil differentiates itself from what we know to be good and in doing so it structures by limitation the content of the good.
I agree that good and evil, whatever that might mean, are part and parcel of the human experience. We all have such dichotomy inside us. So like everything else in our human reality, our attributes and inventions are two edged swords.
But we can change how we manage our 'evil' compulsions, and all it takes is Emotional Intelligence. EI and it's behavioural attribute emotional competency can be learned; as long as the person is open to learning and emotional development, which sadly, many are not.
But we are a very young race which has not yet reached the Emotionally Intelligent "tipping point." So who knows what our future survivors will look and act like; If the race actually survives.
But I am optimistic.
Good and evil are religious concepts.
There is in reality only benefits and harms, and subjective assessments of same, seen through various filters. Human nature is mostly down to us being irrational and biased in ways that worked better for hunter-gatherers than for modern technological urban dwellers -- and even in the hunter-gatherer age, it selected for survival, not thriving.