I was reading in an old public domain dictionary that 'donkey riding' had a special meaning. I forgot what it was, but I found
another one that might be the same, which says it means cheating with weights and measures, or miscounting. That might fit with the song, since it does seem to be about people making off with goods or money (in good conscience or not).
I just wanted to point this out since I don't see anyone else on the Internet pointing out the old secret or slang meaning for 'donkey riding'.
The version of the song I'm familiar with is by St. John Children's Choir in
Children S Sing-A-Long Favorites, disc 2 track 8. There are a lot of cool songs on that album that I hadn't heard in other large collections of nursery rhymes, childrens' songs, and such.
One alternative is that the donkey riding could represent peace (but nursery rhymes tend to be about satirical political things, if what people say is the truth):
https://www.gotquestions.org/king-ride-donkey.html (note this link is religious)
Or it could be literal!
song_music_children_donkey_meaning_mp3_