In WWII the Allies allowed some of their own cities to be attacked because they didn’t want their enemies to know they cracked their communications codes so, they could counter attack on more important targets.
You must be referring to the claim that Churchill let Coventry be bombed to avoid exposing an intelligence asset. That's actually a myth that didn't arise until 1974 and has been discredited. The British government was aware that a raid was being planned, but didn't know the target, and when news came that it had been launched, they assumed the target was London and were taken by surprise when it turned out to be Coventry, because they didn't decode that information in time.
http://www.winstonchurchill.org/learn/myths/myths/he-let-coventry-burn
http://en.wikipedia.org/wiki/Coventry_Blitz#Coventry_and_Ultra
There's also a myth that FDR knew Pearl Harbor was coming and let it happen to anger Americans enough to get us into the war, but that's never been more than a crackpot conspiracy theory.
The difference is that Section 31 isn't a legally sanctioned entity like the Tal Shiar or Obsidian Order.
Exactly. I'm amazed how many people confuse Section 31 for a legitimate intelligence agency like Starfleet Intelligence. An intelligence agency has the oversight of its government and the legal authority to act. Section 31 is an unsanctioned, extralegal cabal within Starfleet. It's essentially a criminal organization, a conspiracy in the ranks.