In regards to security, Apple does have three upsides, and only those:
- No sideloading and no unlocked bootloader means you can't sideload malware or install malware-preloaded ROMs. No root also means you can't just install malware that uses root access.
- Long OS support means fewer people run around with iPhones that are 5 OS versions behind.
- There's no tiny boutique iPhone manufacturers who sell phones that come pre-loaded with malware.
The solution for the first one is "don't sideload untrusted stuff" and the solution to the second and third one is "buy an Android phone from a trusted manufacturer that has long term OS support".
I'm not defending apple here. Short OS support (or none at all) is not a good thing, and it's something that's sadly still quite common if you buy the wrong Android brand.
Samsung is doing pretty well in that regard right now.