CAPTCHA or Completely Automated Public Turing test to tell Computers and Humans Apart serves more than just preventing spam. By entering the words in the box, you are also helping to digitize texts that were written before the computer age. The words that you see are taken directly from old texts that are being scanned and stored in digital format in order to preserve them and make them more accessible to the world. Since some of the words in these texts are difficult for computers to process, it uses the results of our efforts to help decipher them. That's why the sign says 'stop spam, read books'.
So, it wasn't a waste of your precious time after all.
Edit:
Many of you are wondering how the test verifies the answer if it doesn't have one.
Here's how: Each new word is given to a user in conjunction with another word for which the answer is already known. The user is then asked to read both words. If they solve the one for which the answer is known, the system assumes their answer is correct for the new one. The system then gives the new image to a number of other people to determine, with higher confidence, whether the original answer was correct. Hope it helped :)
Edit 2: As has been mentioned, this is actually reCaptcha. Not all Captchas are used for digitizing books. Thanks Varun and Naveen.