Excuse me for just pasting the first half of this post rather than editing it, however the information is rather apt.
Why were you infected, there could be several reasons?
Basically your security, both programs and user behavior, has fallen down and allowed an infection to pass through your defenses.
How many users are on your computer besides you? Do you know their surfing habits? Are your users using an Administrative account rather than, the less damaging in case of problems caused by malware, Limited User account?
With Administrative privileges anything which gets into your machine can do whatever it likes, but if you are only a Limited User then any damage is limited too.
Programs like virus scanners only mainly concentrate on viruses (and some more common worms and Trojans), but that still leaves many worms and Trojans as a danger. Which is why many people have what is loosely termed a "layered approach", where you have specific programs for specific threat attacks. You can spend lots of money preventing the chances of infection but the biggest danger is from sloppy user control.
Another thing to watch out for is portable media such as DVD's, CD's or USB, shared and inserted by friends from other less controlled machines.
No matter how good your virus scanner is, unless it knows about an infection threat (updated definitions) it will not detect it, although many have heuristic detection to advice of a possible infection or suspicious file, which produces as many false positives as it does positives.
To help your virus scanner manufacturer/programmer you could send them a copy of the infected file, via a zipped file and E-mail so that they may better handle it in the future.
Basic security on any computer should in my opinion include Ad-Aware and Spybot Search and Destroy as well as a good Anti Virus program.
Spybot - Search & Destroy
Ad-Aware 2008 7.1.0.8
Removing adware & spyware
faq608-4650
Windows Defender
HijackThis Tutorial and download
I see lots of recommendations here for programs like -
SuperAntispyware
Malwarebytes' Anti-Malware
And finally, here is something that is a bit scary.
Don't be a victim of Sinowal, the super-Trojan