(1) If you are punishing someone or something else (an animal, say), the latter probably represents a part of you - some quite respectable facultv or instinctive drive - that has at some time in the past given rise to guilt-feelings. Such antagonism between different parts of your psyche spells misery. Healing and happiness will come only if you learn to forgive and accept the repressed faculty or emotion and allow it proper expression in your life.
(2) The person you are punishing may represent someone close to you: parent or partner, or sibling. In this case be careful to distinguish three possibilities: first, that the dream is expressing (unconscious) resentment against the person; secondly, that what you are punishing the person for is a part of yourself that has been projected on to the person; and
thirdly, that the person, though recognized in the dream as someone else, nevertheless represents some part of you: in which case see (1) above.
(3) If vou are being punished, who is doing the punishing? A father figure or other authority figure (e.g. policeman or judge)? If so, you probably have an over-dominant super-ego. Did you as a small child see your parents in a sexual embrace and as a result incur the wrath of either parent? Some such traumatic experience could easily set in motion a self-punishing mechanism that will perpetuate itself as an autonomous function of your psyche until you choose to do something about it.
[1]