Keeping a team motivated is one of the most important and sometimes most difficult tasks of leadership. I don't like saying "motivating a team" because you actually can't motivate people. People have to motivate themselves. But a manager can help a lot so that his subordinates don't have such a hard time getting there.
In IT management, you lead a special kind of employees: geeks. Some managers find it difficult to understand those IT guys and their ways of thinking and acting. But the Retrospector found some common aspects that managers better keep an eye on. He titled his blog entry Top 10 Ways to Motivate Geeks, which I want to rephrase (for the reasons mentioned above) "Top 10 ways how to keep geeks motivated". The 10 things to give them are:
Opportunities to learn
Room to figure out things on their own
A chance to be creative
The right level of privacy
Free stuff like t-shirts or food
A certain amount of control
Recognition where credit is due
Freedom to choose and decide
A proper compensation
From my experience, those really are important aspects in managing geeks, but you have to keep all of them in mind. Free stuff alone won't be enough to maintain a team's asskickingness.