A lot of those are some sort of pun or reference on the topic at hand: The crab as as a reference to Ferris/Rustaceans on the Rust book, spiders on books for "webmasters", the snake on Python Programming, etc. Others were just assigned at random (and proceeded to become indelibly associated with the language, like the perl camel).
A list of the animals, and some history:
http://www.oreilly.com/animals.csp https://www.oreilly.com/ideas/a-short-history-of-the-oreilly...