Both operating systems (OS) have their advantages and disadvantages, and users have their own preferences. In general, Linux-based web servers face fewer threats because it is not as widely used as an OS as Windows is. Additionally, because it is open-source software, anyone in the Linux community can quickly resolve security issues as soon as they are detected.
One of the security advantages of Windows is that, as a license-based OS, access is limited by default, creating some inherent protection against hackers.