If they're only going to scan photos that will sync to iCloud Photos, why wouldn't they just keep doing it server-side? As far as it's publicly known, no one asked Apple to do this.
Apple is very pro-privacy and probably doesn’t like having access to unencrypted customer photos. But if they just encrypted everything it would be a child abuser’s dream because suddenly they’d be safe on iOS, and when people found out Apple started protecting them it would be a disaster for PR and law enforcement.
After much consultation their solution was to scan for known abuse images on device so they could be kept in the cloud in an encrypted form without providing abusers a safe haven.
> why wouldn't they just keep doing it server-side
Because they want to scan files that will be encrypted on your device and not transferred to the server as plaintext. No doubt they'll continue to scan unencrypted files server side.
> no one asked Apple to do this.
If someone asked them to it would turn it into a warrantless search with Apple acting as the state agents to search your possessions. It would almost certainly result in the evidence being tossed by any US court. This kind of warrantless search only works if Apple does it of their own accord, instead of on the governments behalf.
Note that this doesn't apply to searches done on Apples servers to data you uploaded, there it's their possessions that they're searching, not yours.
Generally search "CSAM apple" and you'll find endless articles about this.