As for the reasons spyware is produced - well, it's all about money. The spyware steals your personal and private information (usually internet viewing habits, but also contact information, names, and other really personal stuff sometimes) and sends it back to its server. Often this is done without any knowledge or permission by the 'user' - in court, spyware companies usually claim 'freedom of commercial expression' to get away with whatever they like and it's worked so far. And sometimes, they hijack your browser itself. When this happens, your start page will be reset to some crap, and bookmarks will appear in your favorites folder (usually porn, gambing, or photographic equipment for some reason). There was even a type of spyware about two years ago which accessed porn sites at regular intervals and then quietly deleted them from the browser's history. All of these tactics ensure that certain sites get a larger number of hits, and thus will make more revenue from ads because they can pretend that a lot of people are actually visitng their site (when in fact the logged IP addresses were hijacked and forced to visit, or the user was tricked with phoney bookmarks). Coolwebsearch is the worst.
Just be careful out there.
Here is a forum which deals with the subject, and which offers good advice on prevention, and offers free technical support. The last time I was there, which was a long time ago, it was very busy though.
http://forums.spywareinfo.com/