With my puppies, they learn that if they make a mess they will get scolded and put outside. And since they want to please me, they are learning to control their behavior.
With my children, they have learned that no matter what they do, there are consequences. For good actions, they not only feel good but others also appreciate their effort; and conversely, bad behavior results in negative responses.
I firmly believe in the necessity of punishment--It is how children learn acceptable behavior. Two things that I try and remember: reward is just as important as punishment and there must be a balance; punishment not abuse, there is a difference between the two and abuse is never acceptable neither from the parent or the child.