The original coinage seems to be from Ira Wolfert's 1943 novel Tucker's People, as...
I'd kill you just as fast as I'd spit a rat out of my mouth, you son of a bitch.
Much later in The Hitchhiker's Guide to the Galaxy (1989), Douglas Adams picked it up as...
I wouldn't trust myself further than I could spit a rat.
I have to admit I find Adams' usage "odd". I'd expect the the imagery to focus on how quickly you want that rat out of your mouth, not how far away from your mouth you want to eject it.
Usually when talking about how "[not] far" we trust someone, the image focusses on what a short distance that is (as far as I could throw him). The reader has no special wish to imagine throwing [him] at all - he just knows if he did, it wouldn't be very far. He doesn't "want more" distance; rather he "accepts it will be less".
But on imagining a rat in his mouth, apart from the fact that primarily the reader wants it out fast, he naturally "wants more" distance, because it's repulsive. That's why it's an "odd" usage - the reader's "more distance" inclination works against the writer's "less distance" intention.
The "spit a rat" usage isn't particularly common anyway, but (possibly because Adams is more well-known than Wolfert), the "not far" sense seems more prevalent than "very fast".
I agree with Joel Brown that Adams' was probably being deliberately quirky, and knew he was mangling the original meaning (it's almost a "mixed metaphor" to me). But I doubt he expected it to be so closely scrutinised - here on ELU, or anywhere else for that matter!