There are many reasons why people make virus/malware. Ill start with viruses.
Viruses are made to prove something such as a hole in Microsoft, a recongnition of the programmers skills "I was responsible for the...", to harvest sensitive information (passwords, ccard numbers and such) or to take over PCs to become part of a "botnet" which can be used for things like attacking webservers to bring them down.
As for malware, its usually made for financial purposes. With Adware you get ads popping up on your computer, they want you to click it and/or buy whatever is being advertised and the Malware maker gets a commission for it. It might be X amount per click, might be a percentage of the product cost.
Spyware is typically used to gain market information. For example, lets say you installed a Music downloading program to get MP3s and it has spyware in it. The spyware will keep track of what type of songs you download and what type of bands, send it back to base and now they have information like who is the most popular band and what genre is becoming more popular so a record company can sign more of that genre.