Earlier quoted context omitted.
Your gmail messages live on Google's servers. It's not ok for them to scan everything, but it's completely different from Apple scanning your phone's content.
The hashes are computed from images that live in iCloud - how is this different?
(Not trying to make a counter-argument to your comment. I genuinely don't get this part).