I came over this blog the other day and I felt it nailed the subject. Money is of course a factor, mainly whether a developer decides to go for a job offer or not. But once inside the door, other factors might influence the developer to stay or not, despite getting a better offer with another company down the road. Check out the blog by Rob Walling:
The list is as follows:

1. Being Set Up to Succeed - working on a project doomed to fail isn’t very motivating. The same goes with working for a company that shows red numbers.
2. Having Excellent Management - Management matters! And if management understands the difference between deciding and managing things get better.
3. Learning New Things - Live on the technological edge is definitely something that aspires. ASP and COM technology isn’t very motivating any more.
4. Exercising Creativity and Solving the Right Kind of Problems - Detailed management decision kills creativity. Hence, motivation for creativity and problem-solving is more interesting.
5. Having a Voice - Most software developers are smart, have some experience, and in many cases specialists. They feel their voice should be heard. Even outside their “box of speciality”
6. Being Recognized for Hard Work - A pat on the back might even be enough.
7. Building Something that Matters - It’s a good feeling to develop something that others will actually use.
8. Building Software without an Act of Congress - Back to creativity and problem solving. Software development is not line production.
9. Having Few Legacy Constraints - Get rid of legacy. Make your own stuff.
Read the full blog here:

http://www.softwarebyrob.com/articles/Nine_Things_Developers_Want_More_Than_Money.aspx