"Sync my files without using Apple's cloud" is not a user requirement. Delivering features using their cloud is a very reasonable way for Apple to provide services.
Now, "Sync my files without compromising my privacy" is a user requirement. And Apple iCloud offers a feature called 'advanced data protection" [1] that end to end encrypts your files, while still supporting photo sharing and syncing. So no, you can't opt out of using their cloud as the intermediary, but you can protect your content from being decrypted by anyone, including Apple, ooff your devices.
It has the downside that it limits your account recovery options if you lose the device where your keys are and screw up on keeping a recovery key, so it isn't turned on by default, but it's there for you to use if you prefer. For many users, the protections of Apple's standard data protection are going to be enough though.
[1] https://support.apple.com/en-us/102651#:~:text=Advanced%20Da....