A better way, I think, is the way Elaine describes. She says first you listen to the child's feelings that motivated the behavior and acknowledge them. Then you state your beliefs/position (teach them a better way, or ask them what a better way would be) and give them a way to make amends or "fix" what they did. This hopefully, because it is like a partnership with the child, helping them to become successful, will inspire the healthy guilt that will make them want to change internally. It actually strengthens the relationship rather than destroys it. And the relationship is a huge motivator for the child's actions, along with their internal moral compass.
If the child still doesn't change his behavior after you do the above, then you just link a privilege to what you want to change, saying something like, "Well, as soon as you get all your assignments in you can go back to soccer practice, because school work is the most important thing before you add more activities to your life. But I know you'll figure it out." This is a much more positive way of doing things rather than saying, "You're grounded for a month!" It gives hope, and leaves the control in the child's hands. They can get soccer back whenever they want it badly enough to change their behavior.
So, teach rather than punish. Offer a way for them to make amends. You'll find this to be a much more effective way to make the internal changes you are looking for and to shape their moral compass for life.
Here is another article on the effects of punishment from a child psychologist.