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.
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.