Here is the solution.
Each building type/level has a plunder cap value, just like the original plunder cap system from 2009/2010, back before they tweaked the ally plunder system and made it all goofy.
If you attack someone with defense that's more than than 1.2x your atk power (building stats atk plus bfe atk and bfa atk for the attacker, building def plus bfe def plus bfa def for the defender, but not propacks/reset items, ) then you earn 1.5x the plunder cap value. Bonus for going for wins vs someone you're not likely to win against.
If you attack someone between 0.8 and 1.2x your power (same thing, atk for attacker and def for defender, when comparing power), you earn the normal plunder cap value.
If you attack someone less than 0.8x your level, you earn 0.5x the plunder cap value. Less gold for going for wins vs someone smaller than you.
The plunder cap values need to increase with building cost, so for example the plunder cap value for a lvl1 SoS should be less than a lvl2 SoS and they're both less than a lvl3 SoS, and then a lvl1 Volary has a higher plunder cap value still, etc. No more of this crap where people used to use L4 guilds but now use L1 SoS because that's how to make good money in a war. No more of that.
Spy stats should play absolutely no role in the calculation of ally plunder. Spy buildings can offer a good plunder cap value, like they always did. But spy stats, actual spy power, should not be factored into plunder calcs in any way. That alone is enough to eliminate OSF from the picture, as pointed out in the OP.
What really needs to change is the plunder cap system needs to go back to a simple three tier system, like I described above. Doing that, combined with substantially better plunder cap values for Volary, T6 etc, would actually encourage people to grow into bigger builds, unlike the way it is now where if you want to war your best bet is to tear everything down and be another boring SoS hansel with strong bfe and bfa.
This, combined with the change to the matching system that I've been working on, would go a long way toward fixing wars. That and roster sizes of 15 max, that would also be a big improvement.