People do evil actions because they lack wisdom. They fail to fight with their hidden animal instincts of senses like lust, greed and anger. They lack Viveka(wisdom) and Vairagya(renunciation) just like inferior animal-insect souls.
lectures_and_discourses/the_mundaka_upanishad
It [the Mundaka Upanishad] leads you on, beyond the senses —
infinitely more sublime than the suns and stars. First Angiras tried
to describe God by sense sublimities — that His feet are the earth,
His head the heavens. But that did not express what he wanted to say.
It was in a sense sublime. He first gave that idea to the student and
then slowly took him beyond, until he gave him the highest idea — the
negative — too high to describe.
He is immortal, He is before us, He is behind us, He is on the right
side, He is on the left, He is above, He is beneath.
Upon the same tree there are two birds with most beautiful wings, and
the two birds always go together — always live together. Of these, one
is eating the fruits of the tree; the other, without eating, is
looking on.
So in this body are the two birds always going together. Both have the
same form and beautiful wings. One is the human soul, eating the
fruits; the other is God Himself, of the same nature. He is also in
this body, the Soul of our soul. He eats neither good nor evil fruits,
but stands and looks on.
But the lower bird knows that he is weak and small and humble, and
tells all sorts of lies. He says he is a woman, or he is a man or a
boy. He says he will do good or do bad; he will go to heaven and will
do a hundred sorts of things. In delirium he talks and works, and the
central idea of his delirium is that he is weak.
Thus he gets all the misery because he thinks he is nobody. He is a
created little being. He is a slave to somebody; he is governed by
some god or gods, and so is unhappy.
But when he becomes joined with God, when he becomes a Yogi, he sees
that the other bird, the Lord, is his own glory. "Why, it was my own
glory whom I called God, and this little "I", this misery, was all
hallucination; it never existed. I was never a woman, never a man,
never any one of these things." Then he gives up all his sorrow.
When this Golden One, who is to be seen, is seen — the Creator, the
Lord, the Purusha, the God of this universe — then the sage has washed
off all stains of good and bad deeds. (Good deeds are as much stains
as bad deeds.) Then he attains to total sameness with the Pure One.
The sage knows that He who is the Soul of all souls — this Atman —
shines through all.
He is the man, the woman, the cow, the dog — in all animals, in the
sin and in the sinner. He is the Sannyâsin, He is in the ruler, He is
everywhere.
Knowing this the sage speaks not. (He gives up criticizing anyone,
scolding anyone, thinking evil of anyone.) His desires have gone into
the Atman. This is the sign of the greatest knowers of Brahman — that
they see nothing else but Him.
He is playing through all these things. Various forms — from the
highest gods to the lowest worms — are all He. The ideas want to be
illustrated.
Everyone is seeking happiness but material happiness is transitory. A Bhogi seeks happiness in matter but a Yogi finds it in Atman. This is also explained in Bhagvata Gita Chapter 2
Bhagavad Gita 2.66 But an undisciplined person, who has not controlled
the mind and senses, can neither have a resolute intellect nor steady
contemplation on God. For one who never unites the mind with God there
is no peace; and how can one who lacks peace be happy?
Bhagavad Gita 2.67 Just as a strong wind sweeps a boat off its
chartered course on the water, even one of the senses on which the
mind focuses can lead the intellect astray.
Bhagavad Gita 2.68 Therefore, one who has restrained the senses from
their objects, O mighty armed Arjun, is firmly established in
transcendental knowledge.
Bhagavad Gita 2.69 What all beings consider as day is the night of
ignorance for the wise, and what all creatures see as night is the day
for the introspective sage.
Bhagavad Gita 2.70 Just as the ocean remains undisturbed by the
incessant flow of waters from rivers merging into it, likewise the
sage who is unmoved despite the flow of desirable objects all around
him attains peace, and not the person who strives to satisfy desires.
Bhagavad Gita 2.71 That person, who gives up all material desires and
lives free from a sense of greed, proprietorship, and egoism, attains
perfect peace.
Bhagavad Gita 2.72 O Parth, such is the state of an enlightened soul
that having attained it, one is never again deluded. Being established
in this consciousness even at the hour of death, one is liberated from
the cycle of life and death and reaches the Supreme Abode of God.