The terms and conditions were clearly laid out for you when you signed up. Google was already well-known for being primarily an advertising company. It was well-known that Google implemented scanning of all mails, both for spam filtering and for advertising purposes.
This is not a "could have, would have, should have" type situation. You deliberately and unequivocally agreed to terms and conditions that very specifically lay out what Google does when it comes to the handling of your mail.