To criticize somebody/something/yourself severely.
To inflict a penalty on for a fault or crime.
He castigated himself for being so stupid. (Oxford)
The minister castigated schools for falling standards in education.
castigated himself for being so stupid
castigating for falling standards
Pull up
Reprimand
Commend
Praise
Castigation