Back in the day when corporal punishment was the norm, a trip to the woodshed meant being taken for a disciplinary spanking, quite possibly to the actual woodshed, if one were handy. There one could be smacked about in privacy, betrayed only by one's own cries, until the error of one's ways had been suitably demonstrated. In this enlightened age, such things are seldom done and even less often spoken of, but the metaphor remains. When someone has transgressed and needs a dose of corrective punishment, the proverbial trip to the woodshed may be suggested.
While we cannot say it of children, it is quite acceptable to say it of politicians and political parties. Many people take a grim satisfaction in giving out-of-bounds politicians a metaphorical taste of belt leather, even if they need to vote against their own self-interest to do so. Sometimes change has to come for change's sake, to clear out deadwood and complacency. And sometimes that has got to hurt a little.