CSAM has nothing to do with device security but with privacy. This is off topic. Also, CSAM is entirely optional anyway, you can just not use iCloud if you don't want to be "spied on" by Apple, and I write this in brackets because willingfully sending unencrypted files to Apple doesn't really quallify as being spied on by them.
This is not about defending Apple, I don't support the CSAM scanning feature neither as I find it useless and insulting.