Wait...are you all sure that they can really masturbate? I mean, humans do it as a means of pleasure, something fun to do. Creatures, other than humans, have to have sex because when they are going through a cycle(females) something in their brain tells them to do this. Almost as if they are doing it as a means of survival(I can't really give you the scientific reason, as I forgot it) to keep the population in exsistance. They don't really have a sense of how 'fun' sex is, it's something they were made to do.
So, with that said, masturbation is a form a self pleasure that humans do for fun, so-to-speak, so I'm confused on wether a male hedgehog is really 'masturbating' or just cleaning themselves. I know that I have walked in on my dog Miki licking himself, like how you all are describing these hedgehogs doing, but he was only giving himself a 'bath', and I believe that's what these male hedgehogs are doing.
Now, as for the male hedgehogs who are humping stuffed animals or what have you, I believe that, because I have a friend whos' chihuahua does that, but it's only around when his testosterone levels are higher, and females do this as well when they are going through a cycle. It's all because they want to relieve(or get rid of rather) that annoying 'must have sex' feeling.
Sorry to get all technical with everyone