Spy marginally benefits top-of-deck effects as well, like Jester, Swindler and Scrying Pool. Its a weak benefit to Scrying Pool, of course, but can slightly up the odds of Scrying Pool drawing you a load of actions. Failing all else drawing it after or using Scrying Pool then lets you use the Spy to scrape up the stuff that Scrying Pool left behind.
I also find Spy is useful for decks which need to chain lots of cantrip effects sequentially, as Jack Rudd says. Not Cartographer good, but sometimes you've got a spare $4 after buying your Grand Markets, and a Spy is better than a silver when you intend to chain multiple cards without proper drawing power.
Pearl Diver doesn't help top-of-deck attacks, of course, so is less useful in that sense, but can I find it has a minor synergy with cards that search through the top of your own deck, like Farming Village, Golem or Venture. That is, if your Pearl Diver gets something desirable, you top deck it (that's the obvious bit). But if the Pearl Diver gets you something useless that you can bypass, then top deck it then bypass it to get that card from your deck to your discard, and hence miss it on this shuffle. For example, pearl dive an estate to the top of your deck, then hit farming village, and you draw the card that farming village would have anyway, but don't have to draw that estate till after the next reshuffle.
I'm not arguing that Spy or Pearl Diver are strong cards, of course, just pointing out a few other ways they might be useful.