The other houses’ mascots make sense. Lions represent bravery, snakes represent cunning, and eagles have a refined quality about them. But what exactly does a badger symbolize? Hufflepuffs are known for their patience, hard work, and loyalty.

Because they're a bunch of stodgy old badgers!
–
TylerHMay 28 '14 at 17:15

2

I'm pretty sure each animal was part of the coat of arms for the corresponding founder -- we at least know for a fact from the book that snakes were associated with Slytherin himself, and badgers with Helga Hufflepuff. It's seems to me a very children's book type device that each founding member had a single prominent character trait, and that each had a coat of arms animal that sort of fits with that personality trait. If you think about it, it would have made more sense for the animals to not match the theme of their houses.
–
KaiMay 28 '14 at 17:40

2 Answers
2

Probably the best explanation comes from the Hufflepuff welcome letter on Pottermore, which makes several comparisons between the house traits and badgers:

Hufflepuffs are trustworthy and loyal. We don’t shoot our mouths off, but cross us at your peril; like our emblem, the badger, we will protect ourselves, our friends and our families against all-comers. Nobody intimidates us.

and a bit later:

You will hear other houses boast of their security arrangements, but it so happens that in more than a thousand years, the Hufflepuff common room and dormitories have never been seen by outsiders. Like badgers, we know exactly how to lie low – and how to defend ourselves.

When Voldemort encounters Hufflepuff’s cup in Half-Blood Prince (while Harry and Dumbledore are using the Pensieve), he finds it has an engraving of a badger.

“A badger,” murmured Voldemort, examining the engraving upon the cup. “Then this was…?”

“Helga Hufflepuff’s, as you very well know, you clever boy!” said Hepzibah, leaning forward with a loud creaking of corsets and actually pinching his hollow cheek.

As far as I know, canon doesn’t tell us when this cup was made, so it’s possible Helga Hufflepuff had a familial connection to badgers. But that’s speculative at best.

Badgers in stories tend to feature either bravery (which was already taken) or loyalty. In addition they make extensive burrows with multiple rooms and entrances that require a lot of patience and hard work to complete.