“Sin” and “evil” can be understood scientifically as doing something against true order. But if you do not know what the true order in the universe is (and there is order in the universe), you won’t know when you are transgressing its laws.
Scientist/theologian Emanuel Swedenborg provided a simple view of universal order as “ends, causes (means) and affects.” The “end” is in the cause, and both are in the affects. (The “affect” brings the “end” into the manifest world as a formal result.)
However, when this order is challenged and changed, hazard (evil) enters into the process. For instance, when we become more interested in the means or causes than in the affects, we are uprooting universal order.
This uprooting of order can best be seen with sexual intercourse, whose designed purpose in nature is obviously to continue the species. But if we strive for the pleasure of sex as our only goal, this order is uprooted and we have taken part in thwarting nature’s grand “end-design” for our mere personal satisfaction.
In such a sexual process, where pleasure is sought for more than reproduction, the “means” takes over the function of the real universe’s “ends.”
Over history, humankind has similarly switched this divine order in almost everything they do. This is why worldly success, money, celebrity and status trump being a genuinely good person.