Recently, I noticed that when I picked up a prescription for a (for me new) medication that's mostly used for one purpose, I suddenly got dozens of spam e-mails wanting to "help" me with a particular diagnosis I don't have. And that's the few that went through the double layer spam filter. It was way too pervasive to be a coincidence.
I've been taking moderately special purpose meds off and on for years (the sorts of things you take when you have a bone marrow transplant).
I have NEVER gotten any spam emails as a result (unless you count that "you really need to refill your prescription since you're about to run out of pills, you dolt!" sort that I get as a reminder from the drugstore)....
I don't know if it's the cause here, but if you Google for something, obviously Google's entire value model is to sell that info to advertisers. Likewise if you send or receive gmail about something. Then there's also looking it up on WebMD or another site to find the side effects. I would be a lot more suspicious of online activity "leaking" to spammers than a pharmacy selling it.