The entire story of the events in Gan Eden dives deep & is difficult to understand, but gaining a basic idea still helps.
As we know from millennia of Torah scholarship, the Nachash is the yetzer hara.
Originally, the yetzer hara was outside a person.
With the First Sin (of not obeying Hashem's one prohibition against eating from Eitz HaDaat), the yetzer hara became internalized within a person.
And it remains within us until today, forcing us into continuous struggles to overcome it.
What is the Purpose of the Nachash & the Yetzer Hara?
The evil yetzer hara is also Hashem's servant.
In a sense, it's our servant too because every time we overcome its temptation, we receive reward (most of it waiting for us in the Next World).
And that was its purpose back then, in Gan Eden.
And that's its purpose now.
But originally, it seems that only Hashem knew that.
Why Did the Nachash wish to Kill both Adam & Chava?
(Thank you to the commenter there for bringing this up for further elucidation.)
Because the Nachash was an exceptionally gifted & skilled animal (strong, intelligent, with the ability to both understand & use speech), Adam invited it into the Garden to serve Adam.
Adam & Chava did not seem to realize that the Nachash was evil.
Yet when the Nachash entered into Adam's service in Gan Eden, it devised a plan against its masters.
According to Rav Yehudah Petiyah in Minchat Yehudah, the Nachash wished to destroy both Adam & Chava so that it could become the master of Gan Eden.
As Rav Petiyah explains in the voice of the Nachash itself:
"...and one day, both of them will die, and Hashem will transfer His Gan Eden into my hands when He sees that I am more intelligent and clever and capable than all the animals. And I alone will be master of the Garden.
"And I will surely go free from under the hand of serving Man...I'll also benefit from no longer eating grass like the rest of the animals because it's not right to work the Garden without eating from it...and if so, I'll eat and enjoy the fruits of the Garden.
"I will also merit to eat from the Tree of Life. And in this way, I myself will live forever."
This is what the Nachash thought in his heart.
Needless to say, both ideas are true.
According to this, the Nachash both wanted Chava immediately, but also wished to get her out of the way to enable his own sovereignty over Gan Eden (which Hashem would never allow, so it was all futile from the outset).
That's what its entire goal was in seducing Chava to eat from the Tree of Knowledge; it knew that Chava would give of the fruit to Adam too.
The Nachash assumed this would kill them (at least eventually) and he would remain as the lord of Gan Eden.
As Rav Petiyah notes, the Nachash
The Root of Evil
Yet Rav Petiyah's statement of the Nachash's wholly narcissistic & psychopathic goal allows us to glean obvious lessons from the idea.
After all, didn't the Nachash realize that Hashem saw everything?
And why on earth did the Nachash ever think that Hashem would allow him to remain as the lord of Gan Eden in place of Adam?
Here, we see the root of true evil—the absolute self-absorption to the point of irrationality.
In addition to being pathologically covetous & destructive, the Nachash's thinking makes no sense. He can't possibly benefit from his scheme.
Also, the Nachash was created to serve humanity.
That was the whole point of its existence.
Had Adam & Chava not sinned by transgressing the one prohibition Hashem imposed upon them, we all would enjoy the services of this intelligent animal until today.
Such a strong & intelligent animal would run our errands for us, including complex tasks like going to the post office & shopping, and much more.
The Nachash could never be a master because it was only ever created to be a servant.
Uplifting the World that Came Crashing Down
Yes, Adam & Chava died, but not right away—only centuries later.
But the Nachash immediately lost its status as the best of the animal kingdom.
It lost its original 4 legs, its cunning, its strength, and its ability to both comprehend & speak.
Snakes today remain useless to people (except for their consumption of harvest-harming rodents). Most of humanity considers snakes as dangerous or frightening pests.
It went from being the lord of the animal kingdom to one of the lowest.
And humanity too lost its status.
Adam & Chava after the Sin were not the same as before the Sin.
And it's a reality with which we still struggle today.
However, if we choose the right decision often enough and if we listen to the voice of the yetzer hatov over the yetzer hara, we rectify the Sin—rectifying the entire world—and bring us closer to Redemption b'rachamim (with mercy & compassion).