A comment spammer’s goal in life is to get their (or their customers) website more traffic by posting links to them, wherever and however they can.
Some comment spammers post manually, but the bulk use bots or scripts attempting to automate the process. Some manual spammers will actually join forums, making at least halfway legitimate posts to increase their post count. Once their post count is high enough they feel they can bypass any scrutiny, they smack the forum with their spam.
So what can a webmaster do to prevent comment spam? It depends on how serious they are about stopping it and how much work they are willing to do.
One thing I do is use Captcha. If someone wants to submit a post or comment, they have to type distorted letters into a box first. While that stops bots from posting, it doesn’t stop manual spammers. It’s also an annoyance for legitimate posters, and drives some away. I regret it, but I don’t want my blog filled with junk posts.
Another thing, every post or reply to my blog is reviewed by human eyes before it’s allowed. I don’t care if if it’s post 1 or post 100 by someone. Nothing gets autoposted to this blog. Sure, it makes more work for me, but I have no intention of being used by comment spammers to make money for themselves and their customers.
I see a lot of generic/irrevelent comments, for example, “Nice post, just what I was looking for.” Of course a link to some random website is included. Others are so entirely off topic it’s obvious what they are. There is no way I will ever give comment spammers a backlink, especially if the site they are hawking is the slightest bit shady, and a lot of them are.
If you have paid webhosting, you should also have logs. Check them. You may be surprised at what some people are up to and to what lengths they will go. I’ve been logging a few persistant pests, probably bots. One of them is up to 62 attempts now. Sad, isn’t it?
Just remember that you do not have to accept comment spam if you’re willing to do some research and a little extra work.