«ضربتُ تأديبًا» specifies the stated purpose of an act, illustrating the purpose complement. «سرتُ والنهرَ» describes movement alongside the river, illustrating accompaniment through a maful ma‘ah construction.
The first answers “Why?” and the second “Along with what?” Their grammatical forms differ, but both delimit an aspect of the underlying action.