Which brings us to the point of punishment. Is the purpose to fear punishment or build character?
The purposes are multiple, but the ultimate purpose is to control behavior. Character is a higher goal, and desirable, but character involves inner motives and maturity, which may or may not come in time, but conduct is either undesirable or unacceptable, which is the immediate trigger for some form of discipline.
Like Maslow's hierarchy of needs, the levels of motivation for behavior are layered, and fear is at the bottom. However, in absence of the others working, fear is not off the table.
There are times when an immediate goal is more about safety or similar, such as when children are tempted to go into the street or touch a hot stove. In some circumstances, the potential for dangerous or fatal consequences might invoke a stronger taboo and a corporal punishment. The mind remembers trauma for a reason. Even though a spanking often inflicts negligible pain for a toddler, the circumstances become marked in memory.
Other times, the learning isn't as urgent or a matter of safety, such as in the case of lying. The punishment is often not physical, but more gradual, and the child loses privilege, or a similar punishment, and learns that actions have consequences.
There seems to be a tenet among anti-corporal punishment advocates that the use of corporal punishment inherently teaches violence or is responsible for the violence in the worid, when that is obviously not true. It can be true, just as the psychological methods used to discipline children CAN lead to a contest of wills, and even a psychosis when the perfect storm coalesces.
There are far, far too many people who experienced corporal punishment as children who did NOT grow up to be violent adults for it to be some cause and effect relationship as touted. Personalities and preferences and behaviors are far too complex to reduce to such linear models.
One of the unintended consequences of the whole discipline debate is the elevation children to adult status in some areas prematurely. Children ARE persons and deserve respectful treatment for ethical, moral, legal, and spiritual reasons, but they are not full citizens and imputing adult status or adult rights is a well-intentioned but wrong-headed move. The argument is made that no adult should be spanked so therefore no child should be. If that line is followed, then a child equally has a right to sexual freedom of expression, or rights to use alcohol or drive, whereas we readily recognize that they are minors with minors' rights in those regards.