Just kidding. No, we don't get paid--sorry. If we did, there would be way more quotes on the covers of books than you see now.
So why do we write them? To help our friends: you scratch my back, I'll scratch yours? No, not quite, though certainly many authors have written quotes for their friends' books. (And, okay--I suppose there are occasions when an author grits hir teeth and writes a quote with more generosity than truth.)
Here's why I do it, and why I think most authors do it: to help out a deserving book. In most cases, the book's editor has asked me to take a look at it before publication, but sometimes I've asked to see it myself. Once or twice, I've volunteered a quote because I simply loved a book and wanted to do what I could to help.
Do I ever decline to blurb a book? Yep. I say no if a book doesn't appeal to me, or if I think it would be misleading to have my name attached to it. Sometimes, I just don't have time to read it before the publication date. (Fortunately, I don't have to say no to the author--that would be hard!--but say it instead to the editor, who acts as a buffer in such sensitive matters.)
The tricky part is when I like a book but don't love it--but do want to help out, especially if it's by a newer author. In these cases, I tend to give a thumbs-up if I like the spirit of the book, even if I don't find it wholly successful in execution. I won't say, "Best thing I've read in years!" but I might say, "Told with passion by an author to watch for."
I try to be true to what I think a book is really about--and then hope that what's left after editorial snipping actually resembles what I was trying to say!