While OSX is generally more secure than Windows XP, this is mostly attributable to it's FreeBSD underpinnings rather than a maniacal devotion to security at Apple HQ. Aside from that inherant superiority, the main thing that keeps Apple with the "more-secure" mistique is simply market share.
It all really comes down to this:
You are an evil black-hat hacker determined to write a virus to cripple worldwide computer networks, or actually more commonly a script kiddie+2 who intends to create a trojan to create a botnet of zombie machines of epic porportions (which you will then sell off to the highest bidder). When doing this, you must first decide for what platform you will code your nefarious creation. Your choices are:
a) Win32: Where you will have the opportunity to infect millions upon millions of machines worldwide, with the potential to cripple economies and national infrastructure (all of which definitely qualifies for a coolness +5 factor).
b) MacOSX: You will have the potential to infect a few million machines in a growing market segment, but the damage will be limited mostly to home users, graphic artists, and some scientists. Most businesses will not be affected, and the government (with the exception of the above-mentioned scientists) will probably not take note. Plus, because of the lack of a devoted virus-writing community you will need to do it all on your own, with only limited "prior-art" to go on. And, to top it off, some of the built-in security of the OS will make it a bit more difficult to accomplish your goal with elegant code. All of this adds up to a coolness modifier of -2.
c) Linux/Unix: This last category is the least appealing really. Here your opportunities for infection are very limited. Not only are there relatively few *NIX boxes out there to infect (though if you count servers probably more than there are Macs), the users of those boxes probably display a higher level of sophistication on average. This makes it difficult to exploit security holes discovered eons ago (as is so often the case with Windows infections), as the potential host machines get patched quickly. Also, while there is plenty of information out there to go on when building your Linux malware, if you are successful and do develop and deploy a devastating piece of code you will earn the scorn of a large community of dedicated hackers who are probably quite a bit more sophisticated than you are. They will then make it their life's mission to hunt you down and expose you.
Once you think about these factors, it's easy to see why there is more malware out there for Win32 machines. The good thing about all of this for Apple is that the fact that anyone cares about these things is because they are gaining market share hand over fist. The truth of the matter is that the average OSX install is far more secure than the average Win32 install for a whole host of reasons (not all of which are about technology), but neither is bulletproof. If you think you are invincible, you're probably already compromized.