I don’t recall if Apple themselves actually advertised for that, but it was definitely one of the commonly cited “data points” online when you were looking to buy a computer back in the late 00’s / early 10’s. Back then, I recall people also thought these fancy new-fangled devices called “smartphones” also couldn’t get viruses, regardless of OS, for the same reasons cited by OP