Well, I can't speak for all OS's, but I have a theory.
In Ubuntu (And other OS's that use a repository), Almost all programs are available from a central location, and have been checked and confirmed as safe and working. You also get all updates from that repository, so that removes a lot of vectors for attack.
Instead of running a random exe off a random site and hoping it does what it says, you can safely add/remove dozens of apps at once, and they add anything they need to work to the download list from a safe and reliable source.
So, *can* you get a special exe that runs a virus? Yeah, I have no doubt. But since Ubuntu users are trained to install from a pre-approved massive list, it is less likely to happen as often as with a Windows OS.
Also, a large number of Virus writers are lazy. They copy/steal each others works, they assume that Windows is on the "C:" drive, they assume IE is available. Since most linux OS's don't conform to this, that is one extra layer of security by obscurity. ^_^ We are only vulnerable to patched/new viruses that target Linux, so a lot of the old stuff is harmless to us.