I suspect we can all point to anecdotal evidence as to whether punishments tend to work or don't. My parents never smacked my brothers or myself and we all apparently grew up as being quite reasonable and not out of control, even if we did have some expected issues.
I think the evidence from studies tends to show that physical punishments (as usually conceived) is often or usually not the answer since it often gives the wrong message (inflicting power over others gives suitable results), often comes from the wrong place (anger, and often exasperation), often is done because other avenues are not even thought about, and lastly, because it often just doesn't work - for many, that is. And perhaps is why so many countries have banned this or are intending to do so, especially those not so religiously inclined.
But, punishment is still seen as just being a natural result of any infringement of codes or laws, and no doubt will stay this way, even as crimes rise and people wring their hands in despair as to 'life always getting worse'. So where has all the 'love for others' gone? Oh, only for those who deserve it, and some are removed immediately from the list of such as soon as their behaviour becomes intolerable.
For myself, I think we as a society need to look more closely at crime and punishment.