It's pretty hard to ask any questions from the first two chapters of Genesis, considering both the esoteric nature of both the topic and the fact that the world seems to have rather different back then in a way that may be inherently incomprehensible for us now that we've been evicted from Eden.
That being said, there are several approaches to this question. (The first three here are quoted by the Ibn Ezra)
It could be that the snake in the story is not literally a snake, but a metaphor for the Satan, or some similar evil force. The Ibn
Ezra himself rejects this opinion, though there are several
midrashim that seem to take this view, despite the obvious problem
of God punishing the 'snake' by making it crawl on the ground.
Chava was a wise enough person to understand snake language (a
parselmouth, בלע"ז)
R. Saadia Gaon says that an angel spoke for the snake, even though
the 'evil plan' or whatever it was that he did wrong was his own
fault (the angel just helped give him a voice)
Ibn Ezra himself does believe that pre-tree snakes could talk, and
though he doesn't mention this lack of punishment, he might reply
that by losing his ability to eat normal food and walk on 'legs' are
symbolic of becoming less human-like and indicate a loss of the
ability to speak as well.
Abarbanel writes that the snake never actually spoke, and though the
Torah states that he spoke, it means that he gestured in way that
his message to Chava was obvious (such as by continually eating from
the tree, and shoving Chava into it, etc.)