To dream of punishment can mean several implication. If you are being punished in the dream, it means you may have done something in waking life. If you are innocent and was still punished in your dream, it might mean that some people are bullying you, for being weaker than them.
If you are the person giving out the punishment in the dream, then the meaning is to show some empathy towards others. If you have to discipline people in waking life, do so with more sensitivity and empathy.
If you are a witness to others being punished in your dream, it means that in waking life, you may be called upon to give evidence because you were an eye witness.