Look at Half Life Gary's mod. Currently Valve (developers of Half-Life) hired him as a full-time level designer .
There can be many reasons; learning, fun (because they actually love the game). I'm pretty sure fun is the most important bit of it, if you game sucks I'm pretty sure no will bother.
Same goes for software, if the software is good or got potential
Open source software is not different than that, take a look at many open source developers and their motivations. Generally because they want to do something, from the scratch or on top of something else.