It’s pretty stupid to say that you publicly share a document, accessible to anyone, but that you hope that a single person will be able to access it.
If you sent that link through WhatsApp, they access it to generate a preview (and who knows what else?). Same for any number of other services.
iCloud, like all other file distribution services, make absolutely no distinction between publicly accessible and publicly distributed. Not should they. They are distributing it… publicly.
… because you made the file public.