There's a difference between "more secure" and "can't get malware." OS X is based on BSD Unix, so is more secure than Windows. Unix was designed from the ground-up with a root/user model. Only root processes can do whatever they want with the system. Apps run as a user and thus can't run amok with your system (unless the owner gives it permission).
Windows was built on the single-user model of DOS. Only one person ever uses the computer, so every app should have permission to do anything it wants. Microsoft finally started changing this with Windows Vista, which is why it was so widely reviled. Apps which were written assuming full access to the system (admin privileges) either didn't work, or popped up so many privilege elevation prompts so as to be unusable.
While no system is completely immune, because of this architectural difference, even if the situation were reversed and OS X had 95% of the market share and Windows 5%, there would still be less malware for OS X than we currently have for Windows.
All that said, a person believing their system is immune is a huge problem. If people believe OS X is immune to malware, they're going to engage in much riskier behavior because they think there will be no consequence. So I suspect it's a bit of a wash. Any benefit OS X has because of its architectural superiority is offset by the myth that OS X is immune causing users to engage in riskier behavior.