“Castigate” means to criticize or punish someone very severely, usually in a harsh or strongly disapproving way.

If you’d like a bit more: people often use it in formal contexts, like “The coach castigated the team for their poor effort,” meaning they were sharply scolded or strongly told off for what they did.