I've built the one with 12 spymasters, and haven't tried the other one, so I can't compare.
What I can say is that both spymasters and legion barracks have the highest monster density, and the highest amount of rare monsters which amounts in more drops when it comes to div's.
It is noticeable how the amount of dropped div's goes down once you've gone through the spymasters and entered the "rest" of the temple. Although I have to say that you'll barely notice the difference, if at all, when you're running with leechers.
That said, you need to keep in mind that with one less spymaster you'll have one more alchemy lab and corruption chamber, both of which will increase the item rarity overall, which can and likely will more than make up for the few more monsters that you get from the extra spymaster/legion barracks.
It comes down to whether you want to slightly increase your chances of getting a lock medallion dropped or not.
Legion barracks, smithies, alchemy labs and thaumaturges can also drop lock medallions ONCE THEY REACH TIER 3! But spymasters seem to have a higher chance of dropping lock medallions than any of the others.
In the end it's all RNG. And I did have 2 runs with 37 rooms capable of dropping lock medallions still not dropping a single one. (12 spies, 13 L.barrack, 8 smithies, 3 alchs and 1 Thau.) So nothing is really safe :)