One of the biggest reasons why malware, especially worms such as WannaCry, are able to spread so quickly is via exposed ports on the public Internet. Many Windows machines, for example, expose themselves via highly vulnerable ports such as SMB port 445 file-shares. Technically speaking, this port really shouldn’t be open by default, but somehow is.
It’s astounding that about one million of these devices out there are exposed. Why this is the case, boggles the mind.