نَحْوُ: «ضَرَبْتُهُ تَأْدِيبًا» أَيْ لِلتَّأْدِيبِ.
Translation: For example: I struck him with the aim of disciplining him—that is, for discipline.
This is a grammatical example from the book, not an endorsement of the act. The grammatical contrast is that the verb phrase states the act and its object, while taʾdīban states the reason.