Here's why:
http://en.wikipedia.org/wiki/The_Answer_to_Life,_the_Universe,_and_Everything
According to the Hitchhiker's Guide, researchers from a pan-dimensional, hyper-intelligent race of beings, construct Deep Thought, the second greatest computer of all time and space, to calculate the Ultimate Answer to Life, the Universe, and Everything. After seven and a half million years of pondering the question, Deep Thought provides the answer: "forty-two."
- "Forty-two!" yelled Loonquawl. "Is that all you've got to show for seven and a half million years' work?"
- "I checked it very thoroughly," said the computer, "and that quite definitely is the answer. I think the problem, to be quite honest with you, is that you've never actually known what the question is."
As to why it's 42, rather than 7 or 1,080,213 or such, Douglas Adams writes this:
The answer to this is very simple. It was a joke. It had to be a number, an ordinary, smallish number, and I chose that one. Binary representations, base thirteen, Tibetan monks are all complete nonsense. I sat at my desk, stared into the garden and thought '42 will do' I typed it out. End of story.
Best,
Douglas Adams