It's incredibly hard to say that DS9 was criticizing anything when all the evidence says otherwise.The criticism of S31 is not that the Federation should never do spy stuff. Starfleet Intelligence long predated S31 in the franchise. It's that the particular flavour of of S31 (tacticool 'ard men making 'ard decisions unconstrained by those know nothing politicians and pinks in Starfleet command) is something DS9 set out to speak out against. DS9 tells us that S31 are weak men, making taking easy decision - which is something that was rather lost in subsequent S31 appearances in the franchise.
On A Pale Moonlight is very very different from how S31 is portrayed in DS9. It's contemplative and philosophical, and that kind of in-depth examination of action is anathema to how S31 seems themselves in their internal myth.
I mean all of S31's actions against the founders were done without authorization from Starfleet command. The fact that no one in Starfleet aside from Bashir seemed to care about their actions. Is a pretty clear indication that they were perfectly fine with what they were doing.