Punishment needs to be effective to create self-discipline in children. Spanking does that. I’m not sure whether there are more effective ways for most parents to instill that self-discipline. I suspect there may be but whether there are or not, its better to spank and have a child who can control himself or herself and be responsible for his or her own actions than a wild little terror who grows up to be irresponsible, lazy, unproductive and a net drain on society and his or her family.
Here is an argument in exactly the same form as the argument you made:
It is better to cut off your child’s hand than to have him grow up to a homicidal maniac and serial rapist.