The purpose is to serve ads and make money. They can do that because people will search for unknown numbers and names.
I've read speculation that they were started by telephone spammers to poison the utility of those who-called-me websites that highlighted spammers' phone numbers. I don't think that's the real reason either. It sounds too cute and clever for spammers. (As an aside: nowadays those services are useless since spammers can so easily fake the caller-ID.)
I'm still thinking that there is an interesting story for the original purpose.