The irony is that Windows 98 is surprisingly secure in many ways precisely because of its obsolescence. Pretty much all modern malware requires the NT kernel libraries to run, and won't work in Windows 98 for this reason. Of course that doesn't preclude some hacker port-scanning your machine, but drive-by downloads of things like ransomware, spyware and keyloggers are largely ineffective!
That's not to say that using Windows 98 is a valid security solution of course, just an interesting side effect of using such an outdated operating system.