The introduction of The Ultimate Spy Book has a section titled "Who Spies?". It divides the motive of spies into 4 categories, encompassed by the acronym M.I.C.E.: Money, Ideology, Compromise, Ego.
Money is pretty straight forward. Financial gain or financial troubles are strong motives for just about anybody.
Ideology is the beliefs a spy has in the country they spy for. The book mentions people who believed in communism and spied for the USSR. On the other hand I have read about Soviets who spied for America because they believed doing so would instigate change for the better in their home country, which they dearly loved.
Compromise is catching the person red-handed and blackmailing them into spying. The book says the KGB used to have dedicated hotel rooms for such purposes.
Ego is playing up to the spy's self-image and building it to keep them going. Robert Hanssen might be an example of this one.
I wonder if the same acronym can be applied to crime. It would be an interesting way of analyzing villains and heroes in novels.