Viruses attack windows because most computers run windows. There are very few virus writers out there. Most viruses come from fools pressing buttons on virus creating tool kits (script kiddies)
There are linux viruses (and Mac viruses) but since script kiddies get their thrills from the number of systems they infect, the low usage of Linux and Macs mean they are not worth attacking.
Some virus writers attack us (the Windows users) because we are much easier targets than Microsoft its self.
Most virus writers are lazy and go for the easy target (us)
Viruses commonly attacks Windows Operating system because these malicious software attach itself as a part of the startup program of Windows. Thus, the virus continues to infect the computer if it has no antivirus software installed. Linux OS cannot be infected by viruses because it is also an application itself and not similar to windows that sets startup programs. In this way, viruses could not run and spread itself automatically.