Unfortunately, most of the time it's attention-seeking.
I'm gonna stick my neck out a little bit here and confess that when I was a teenager I was a horrendous troll. I was a member of a very specific, very elitist community that actually made a name for ourselves on a kiddie/teen website for trolling on their messageboards. We did it to show off, to brag amongst ourselves about how much better we were, and to push boundaries.
We all grew out of it. Some people don't, and go on to just get worse and worse, until threads like the ones mentioned start popping up. A lot of them have problems - I knew a girl who was so lonely in real life that she would pretend to be anyone just to get people to talk to her. She'd pretend to be a boy, pretend to be terminally ill, anything, because she thought she was so boring she needed to be someone else for people to like her. 
(She's better now, btw)
With some, it's more sinister than that. Being vague so I don't out myself, I was once sucked in by someone's sob story (not on MN) and forked out about a hundred quid's worth of help before they admitted they'd just been stringing me along, and promptly buggered off.
Guess what I'm trying to say is, it's hard to gauge the motivation behind anyone who does this, but I do think it stems from MH issues.