Proverbs 17:26

17:26 It is terrible to punish a righteous person,

and to flog honorable men is wrong.

Proverbs 19:25

19:25 Flog a scorner, and as a result the simpleton will learn prudence;

correct a discerning person, and as a result he will understand knowledge.