To dream that you are punished signifies guilt or shame about your actions. You need to learn to forgive yourself. Are you punishing yourself?
To dream that you are punishing others signifies hidden resentment towards that person. Alternatively, they may represent aspects of your own personality that you fear or that you are trying to repress.