If software can be built to recognize faces and match those faces to names, then how is that CAPTCHA works? Recognizing letters seems a lot easier than matching faces.
Captcha doesn't always work; hackers use ever more sophisticated techniques to try and defeat it. In response, Captcha systems distort the letters in some way to confound those techniques, either by twisting the letters, putting a line through them, reversing the background and foreground colors randomly, and so on.
This relies on the human's ability to still read the words in the presence of a lot of noise, a quality most OCR algorithms do not have.
In other words, Captcha works because we can obfuscate it in ways that makes it difficult for a computer to solve. The same principle applies to any sort of computing security apparatus: we seek to find ways to secure content that are easy for humans to use, but hard for computers to reverse-engineer. We are not always 100 percent successful in that regard.
Facial recognition doesn't always work either. Despite the implication in your question that computers are better at it, the same problems that face Captcha solving algorithms also apply to facial recognition software: you still need a good candidate image, the process can be confounded by shadows, etc.
Note that Captchas don't have to be perfect. The most trivial of Captchas still eliminate 90 to 95 percent of the spammers; the good ones eliminate 99 percent. It's not about keeping everyone out; it's about closing the door so that not any Tom, Dick or Harry can just walk through the doorway without some sort of challenge.
Ultimately, most spammers are lazy, and aren't really in the business of writing sophisticated software algorithms to defeat Captcha's, unless the potential payoff is especially great. They're after the low-hanging fruit.
It all comes down to recognizing patterns. Facial recognition works by recognizing patterns (distance ratios) of facial features, as well as shadows. These ratios are looked up in a database to try and match an actual face - this isn't flawless however and can bring up false positives.
CAPTCHAs and reCAPTCHAs use distortions to muddle recognizable patterns of letters and numbers, to make it difficult for OCR algorithms to understand them.