Why do hedgehogs have spines
Why do hedgehogs have spines
They're vertebrates, they're born that way. An animal looking like that and living like that has to have some sort of supporting structure, and for the hedgehog it's a spine.
Or maybe you're thinking of the things that make them prickly, not the backbone. There are plenty of animals out there who would make themselves a meal of a fairly slow and harmless animal as a hedgehog, so the spines developed as a defence. If threatened the hedgehog curls up into a prickly ball, and anyone trying to bite or claw it end up getting hurt.
THe hedgehog ended up taking that route instad of developing an ability to run, hide or bite back.