Who said macs were more secure than Windows?
Since 1995 people have been finding flaws in the Windows operating systems. Over the 20 years, lots of apple fans have said "OSX (macOS) is more secure than windows" my believe is this has been because Windows as the dominant operating system has been the target of pretty much every security researcher and hacker. Which make sense, as why bother trying to attack a minority of users when it's easier to make a single attack that will catch more computers out.
However, in recent years Apple made it's comeback (fueled by the iPhone) this, combined with MS's blunders (windows vista, windows 8) has lead to an upsurge in popularity for Mac based computers. (I get why, as I have a couple of Mac's myself) Over the last few years Mac's have been getting more popular. When that popularity, so the eye's of the security researchers and the hackers have turned to bring these devices into their gaze. Whilst in years past it was true that you didn't need a virus scanner on a mac, this was mainly because no one bothered trying to exploit those machines. This is no longer the case and the mistakes that will have already been made and fixed by MS are likely to be coming to light in macOS.
If Linux ever gets to the same popularity levels where it could be used by just about anyone (which I contest at the moment it can't, there's still things that prevent it from being used by the silver surfers and kids, I'm talking about the people who can barely find the power switch) this is when I'm fairly sure that some software blunders will come to light in that OS as well. The same can be said for just about any OS, large or small.
Linux does have a few advantages, it's use in server environments for one. But just look at the world of IoT, alot of which are Linux based, so I wouldn't say they're fairing much better really.
In summary, these things happen, and I call them growing pains. Just a shame that whilst Apple has extra time over MS, it seems they spent the time on Shiney bits rather than making sure the foundations are properly solid.