The snake is an allegory for death, in my opinion. The snake talks about the power to send a person further away than a ship, and whatever he touches he returns to the earth from which it came and he resolves all puzzles (enigmas). It is only by death (sleep/ dream) that the Prince may be able to return to his star, his body is too heavy.
And I agree with Fenfen, it is the difference between like and love that he realizes in his journeys. This difference made his flower unique from all other flowers. That is why he must return now; he understands his feelings. He had to learn, thus he had to travel.
Hi again. Snakes are hidden where you do not expect--so that's life: if our mind is filled with obtuse thoughts (like many features in this book), we are not ready to react to the events of life -- and we have no "free rooms" in our heart.
In any case, sooner or later, Death will come ... hidden and misterious like a Snake.
So the Snake, in the Ancient mediterranean religions, is "the Power to Predict the Events" (Prophecy).
In the summer, I love to walk in the fields with sandals and I am a bit worried about snakes. But we cannot continuosly be worried about everything: while Anxious people cover their mind inside an Armor, good people accept life as it comes--good or bad-- because there is no way to cheat the Destiny.
The story between the little prince and his rose explains the difference between like and love.
If you like a flower, you will pick it. If you love a flower, you will water it every day.