There was a radio interview, a few years ago, with the producer of the Hitchhiker radio series. He said he suggested it because of its link with Lewis Carroll, and Adams went with the idea. The number crops up a few times in the works of Lewis Carroll (Carroll was 42 when he wrote The Hunting of the Snark, the Baker in that piece has 42 pieces of luggage and if I could find my annotated Snark I'd be able to give you other instances)
yes, it was originally a radio series, or at least the first book was; I'm not sure about the rest (I don't think 42 makes an appearance till late in the series)