scanning for spam does not have to extract the context. Scanning for serving ads probably does?
To filter spam, you need to make enough sense of the email to identify it as spammy, according to some algorithm. To serve an ad, you need to make enough sense of the email to indicate it's about something one or more of your advertisers cares about. I can't think of a way to distinguish between the spam robot's access vs the ad robot's.