The woodchuck is an extremely rare creature. Otherwise, it serves no special purpose, apart from being a pain to extinctionists. It can swim.
The woodchuck's stats appear almost identical to those of the rock mole, which precedes it in the monster list. The only differences, besides the generation frequency and the glyph color, are its diet, ability to swim and tendency to wander. Note that both the woodchuck and the rock mole are tunnelers and as such can chop down trees and tunnel through rock walls.
The only way you may ever see a woodchuck in your game without intentionally generating one (e.g. using reverse genocide) is if a monster is polymorphed. Additionally, a chameleon or other shapeshifting creature may assume the form of a woodchuck.
Its inclusion is a joke, to do with the Oracle and "How much wood would a woodchuck chuck if a woodchuck could chuck wood?". The joke is a reference to the real life Usenet Oracle. The internet has the entire text of Oracularity 576-06.
In some variants, including UnNetHack and xNetHack, woodchucks attack the Oracle on sight as part of the grudge patch. In UnNetHack, one woodchuck will always appear on the Oracle level, and can very rarely appear over time.
In SLASH'EM, woodchucks are marginally more common, as there's often a single woodchuck generated in the Oracle level. On Groundhog Day (February 2), many woodchucks spawn on the Oracle level, with a recurring message of "No more woodchucks!"
The Usenet Oracle requires an answer to this question!
> How much wood could a woodchuck chuck if a woodchuck could
> chuck wood?
"Oh, heck! I'll handle *this* one!" The Oracle spun the terminal
back toward himself, unlocked the ZOT-guard lock, and slid the
glass guard away from the ZOT key. "Ummmm....could you turn around
for a minute? ZOTs are too graphic for the uninitiated. Even *I*
get a little squeamish sometimes..." The neophyte turned around,
and heard the Oracle slam his finger on a computer key, followed
by a loud ZZZZOTTTTT and the smell of ozone.