Before he was the Buddha, Gautama Shakyamuni practiced asceticism, and described some of the extreme things in the suttas, which I won't repeat, but after Awakening, realized none of them were useful in ultimately overcoming suffering.
Monks and nuns live a way of life that we, with our modern comforts, would call ascetic, but perhaps is more accurately called simplicity, or the minimal requirements for life and a reasonable level of comfort. Ajahn Brahm tells a funny story about when he used to go and teach in prisons, and how the inmates were shocked and appalled at all the things he wasn't allowed, that even they had in an Australian prison.
The Middle Way is the way between extreme indulgence and extreme asceticism, and duality in general. In a sutta the Buddha said he crossed over the flood by neither moving forward nor standing still. The Middle Way is neither indulging in or chasing after sense pleasure, nor hurting and depriving yourself with the idea that dukkha can be overcome by amplifying and enduring it as a way to desensitize yourself to it and eventually not care, so nothing bothers you. Silabbata paramasa means wrong adherence to rites and rituals, of which, sleeping on a bed of nails or holding your arm over your head for years on end until it's shriveled, would presumably apply.
Extreme asceticism is actually almost a kind of dabbling in suffering, in that you're the one in control, so that if it gets to be too much to take, you can stop at any time. But with real, or natural suffering, you can't stop it, you're not in control. And no matter how much austerity you impose on yourself, you still have the sense of being a doer, a self. And the sense of self is said to be the root delusion, that keeps us chained to the cycle of karma and rebirth and suffering.
But yeah, to a certain extent, depriving yourself of so many of the sense pleasures we take for granted, is standard practice for monks and nuns, because it does help them turn away from the world, and make their lives a lot less "cluttered" so they can investigate the real nature of things, instead of miring themselves deeper in it by chasing after and rejecting the neverending stream of phenomena.
As for being able to facilitate certain or various attainments, like the siddhis, I don't know. But monks wouldn't do it for no reason. The Dhammapada says that among ascetic practices, patience is supreme. There's the account of the Buddha encountering a sadhu by a river, and asking him what he'd gained from his austerities; he said that he could now walk across the water, and the Buddha replied that he'd wasted his time, because for a copper he could cross on the ferry.