Apple should either remember those privacy-related settings or don't enable any privacy-leaking settings (like iCloud photos) by default. At least as long as they claim to be privacy-aware company.
How can it remember settings after you sign out?
The same way it keeps your files, photos, and any and all state of your devices. Signing out is not the same as deleting all information from the account.
There’s plenty of things you need to sign in to do other than sync.
For instance updating your payment info or your account info (name etc)
iCloud sync is just one of the features you might use under your Apple id