Why do trolls go trolling?
Some trolls are True Believers, who want to spread their personal gospel. These tend to be argumentative, but don't purposefully try to be offensive (although they may well succeed at it unintentionally). Classic examples of these are ideologues of either conservative or liberal varieties that wander into the blogs of their enemies and proceed to wage war.
The majority, however, are simply doing it "for the lulz". There's a dark humor in getting people worked up over what amounts to (in the troll's mind) absolutely nothing, along with a general sense of power. Combine internet anonymity with a sense of entitlement, boredom, and aspects of internet culture that flat-out *encourage* doing nasty shite simply "for the lulz", and you get trolls. They're a small percentage of netizens in general, but their effect is... disproportionate.
I believe it's related to why I read crank.net and Fundies Say the Darndest Things. Humor can be found simply in watching people make fools of themselves, and the definition of "fools" is entirely subjective. I personally only watch free-range folly, along the lines of Kent Hovind's "arguments" against evolution and random cranks building ostensible warp drives, and eschew considering valid emotional responses as 'funny', but I can see how the same impulse can lead into trying to create such 'foolishness' in the form of just getting riled up in general.
This is why I love Shakesville's troll comment policy. Instead of responding to the troll, giving them the satisfaction of 'amusing' righteous anger, the troll's comment is rewritten and the ridicule is turned back on the troll. For example:
I eat my own poopy!
[This comment has been replaced by the moderators with a paraphrase as per the Shakesville Comment Policy.]
Part of the trolling impulse is also a half-immature, half-Forbidden Fruit response, where trolls are gleeful at saying inappropriate things purely because they are inappropriate. It's the same sort of humor as Dead Baby jokes, which are only funny insofar as they are completely horrible.
If anyone with a strong stomach (trigger warnings everywhere; NSFW by the love of Ceiling Cat; rape, racist, sexist, fatphobic, homophobic, you-freakin-name-it jokes abound) wants to observe trolls in their own habitat and hear their logic, the 'safest' way to do this is to go to the Encyclopedia Dramatica (Not Safe For Work, I tell you again!)** pages for "lulz" and "troll".
**I do give ED props in that they actually get and lambast (surprisingly enough, given their target audience of basement-dwelling internet nerds) the classic Nice Guy syndrome. But overall the site is very good at its goal, which is to reveal in exquisite, high-resolution detail the mindset, zeitgeist, and worldview of 'Anonymous'... which is a large collection of very, very sick fucks.