Our journey in this world began with the union of 2 cells and their growth into what we consider to be "I". Week 5 of embryonic development the nervous system begins to form and by the 3rd trimester the 3 primary functional components are in place. These components are categorized as Sensory input, Motor output and Central integration. The primary purpose of the nervous system is movement toward something we want (ie food) and away from something we don't want (ie predators). These 3 functional components make this possible by sensing the environment, integrating that information, and generating a motor response. The establishment of this circuit establishes the subject/object or Self/Other dichotomy and is the birth of Ego. Prior to this, we were simply cells at one with all the inputs that created them (carbon from a long dead star, oxygen from plant life, and nitrogen from the death and recycling of this plant life, ect ect).
The sensory input coming into this "I" is in the form of smell, sight, sound, touch, and taste and can be loosely divided into 2 categories, Pleasure and Pain. The "I/Ego" judges the pleasurable inputs as good and the painful inputs as bad and learns to desire one and fear the other. This is not necessarily a bad thing and is necessary for the basic survival of the organism. The error in judgment here is not everything that is pleasurable is good (ie too much sugar or alcohol) and not everything that is painful is bad (ie learning your multiplication tables). In fact, there's an argument to to be made that the fastest way we learn is through the pain of failure.
Babies come out of the womb hardwired for this Desire/Fear combination in the form of 2 primitive reflexes. The Suckling reflex is seen when tickling the baby's cheek causes them to move their head toward the stimulus in Desire for food. This reflex activates the Parasympathetic or REST/DIGEST nervous system which governs growth, healing, and digestion. The Moro reflex is seen when a loud noise causes the baby to extend their arms and legs quickly in Fear to protect themselves. This reflex activates the Sympathetic or FIGHT/FLIGHT nervous system which governs the quick activation of resources to fight or run away from threats. Too much parasympathetic activation can cause lethargy, eating disorders, addictions, inability to focus and brain fog. Too much sympathetic activation can cause adrenal fatigue, high blood pressure, anxiety, insomnia and PTSD. So we see that extremes of Desire and Fear are not healthy for the organism.
Through the process of neuro-plasticity the desire for pleasure and the fear of pain grows to include more and more things in our reality and take on a reality of their own. Desire grows into Greed, Envy, Gluttony and Lust. Fear grows into Anger, Pride and Sloth...the 7 deadly sins. If you think about it though, there are elements of both Desire and Fear in all 7 sins.
As "I/Ego" and judgement grows, so does Desire and Fear and the resultant 7 sins until you have a world situation like we have today.
Knowledge of how we got to our current dilemma is nice, but what do we do with it? The mystics of all religious traditions know that the Self/Other dichotomy (ego) is a creation of mind. If you know how the process begins, then limiting Ego to that of a child's because "of such is the Kingdom of Heaven" would be a good place to start. Also, "Judge not, lest ye be judged" makes more sense because the more you fire that judgement circuitry, the more it grows until it becomes that little voice in your head that judges and berates you for your shortcomings and creates shame. The story of Adam and Eve talks of the fruit of the Tree of KNOWLEDGE of good and evil...which would require a judgement. Prior to this judgement, nakedness was not considered evil and providing our daily needs was natural and not "earning our living by the sweat of our brow". Limiting desire and fear can be achieved by complete acceptance of whatever happens and perhaps by reciting the mantra "Not my will, but Thy will be done" which helps to limit the extremes of both. You need just enough Ego, Desire and Fear that you don't starve or "walk in front of a bus" as Suzuki Roshi said.
True Love helps us to transcend all three extremes, but only if it is "unconditional" or "without discrimination" as Thich Nhat Hanh says. As is expressed in the Tao Te Ching, virtue (or love) that is shown in order to get something in return is transactional love, not true love. True love limits ego, desire and fear to the point of being willing to lay down your life for another, it's highest expression.
If you understand, that the Self/Other dichotomy is a creation of mind and not an absolute border between Self and Other, then these verses make more sense;
Therefore all things whatsoever ye would that men should do to you: do ye even so to them: for this is the law and the prophets. Matthew 7:12
"You shall not take vengeance or bear a grudge against your kinsfolk. Love your neighbor as yourself: I am the LORD." (Leviticus 19:18
"Never impose on others what you would not choose for yourself." — Confucius[14](c. 500 BC)
"What you do not want to happen to you, do not do it yourself either. " – Sextus the Pythagorean
"Treat your inferior as you would wish your superior to treat you." The Stoic Philosophy of Seneca
"...and you should forgive And overlook: Do you not like God to forgive you? And Allah is The Merciful Forgiving."
— Quran (Surah 24, "The Light", v. 22)
"One who, while himself seeking happiness, oppresses with violence other beings who also desire happiness, will not attain happiness hereafter."
— Dhammapada
We are born with the neurology necessary to survive, but like any tool, it can hurt they wielder if not used properly. Used properly, it can create a masterpiece of a life.