Over the years of being involved in the building of multiple Online Communities, Social Media sites and occasionally even online games, I have developed some understanding on how the motivational mechanics behind everything work. Here are 3 things I have found to be well-proven, meaningful and important in building long-lasting communities and active social structures online:

CC Attribution: rustman@Flickr
1) Inequality in Online Communities is a good thing.
Everyone cannot possibly be the same. Any active and long-lasting online community needs to have a structure that automatically creates inequality between its users.
Take World of Warcraft as an example;
* 10+ million people play the game worldwide
* about 4.6 million of them are organized in Raid Guilds
* there are 116682 Raid Guilds
* only 3.57% of them play in the "end game" level
* and only 0.30% of them have "completed the game" and all content in it.
That ends up being a tiny fraction of the original 10+ million players. The further you advance in World of Warcraft, the better gear you get. The more inequality there exists between your character and the newbie who just started playing the game.
Now if you were to give all the excellent end-game stuff to all newbies for free, without any achievement, what do you think that would do to the players motivation to play the game?
Social Networks, Online Communities, Social Media sites etc.. they follow the precise same pattern: there needs to be lots of stuff that sets people apart. Things only great achievement will get you, things that require spending money and time on the service, etc. Do not in any case give everything away for everyone for free = it automatically creates a situation where nothing is perceived as valuable and people don't want it then.

CC Attribution: gwen@Flickr
2) Forget traditional segmenting of customers entirely.
Traditional segmentation methods like putting people into neat little category boxes as in; "male, 25 years old, university education, lives in a big city".. that data means precisely dick and will not in any way correlate to the behavior of your consumer-customer. You will do yourself a favor if you abandon this ancient method of "boxing your customers".
What matters then? Things like: Values and Attitudes, Interests, Media Usage habits, Consumption habits.
The best stuff in a long while (possibly ever) published about this in a form of a study is the "Global Habbo Youth Survey 2008" that's been done by Sulake and sold here in their webstore. That's an excellent example of how to do it right - in a way that is meaningful and has strong correlation to the actual measured and perceived customer behavior.

CC Attribution: CaDs@Flickr
3) Negative motivators play a key role in Online Communities.
In this case "negative" is not actually negative, since it ends up benefiting your business, it's just seemingly negative. What are negative motivators? They are seemingly negative things that motivate people to spend time and money in your service. Things like: ego-stroking, drive to compete strongly, flaming, pissing somebody off, kicking somebody's virtual buttocks, revenge, people trying to be smarter than someone else, people wanting to show off, people gossiping, acting tough, etc.
This behavior is the norm in online games, and I claim that it is an essential part of every online community out there. Why do you think some open source programmers publish beautiful amazing code? There reason may very well be ego-stroking. Why do you think people in www.irc.fi buy their pictures to the front pages for a few minutes at a time with 3 euros per pop? They want to show off and be famous. Why do you think people endlessly edit Wikipedia? they want to win somebody else in competition and be smarter etc. Why do you think people put "Am I HOT?" -typeof apps to their profiles in Facebook? They are motivated by ego-stroking and possibly by trying to be prettier than the next lass.
Seemingly negative motivators are the other side of the "sunny and happy" coin that is more commonly known. Communities do not exists only to help out your fellow community members, or for "crap" like peace and unity. They exists as a part of life, including the negative aspects of it. Only the really strong and active communities can grasp this well and utilize it to their benefit. The result is an intense user experience that feels more like life than some superficial online service, and will get your customers engaged and paying money etc. IRC-Galleria is a prime example of this; activity is at the highest level of any known online social networking / social media site in the world. IG's 502 thousand active users generate up to 4 billion full page loads per month and nearly 90% of them log in every day. The VIP users (who are a very significant % of the userbase) use the service so much that their monthly usage hours start to surpass TV in many cases. All this at least partially comes from encouraging and allowing seemingly negative motivators to fuel the process - it has to be life, all aspects of it, before it can be holistic and truly engaging for users as an experience.
Hi. My name is Taneli Tikka. This is where I preach what I practice. I'm a
serial entrepreneur and a startup activist of sorts. People usually know me
from my past and present consumer Internet service projects: IRC-Galleria,
Dopplr, Muxlim, StarDoll, RunToShop, Vakuutuskone.com, and a bunch of other stuff. My
"proper" bio is behind this link. Glad to see you here, thanks for browsing
around.