In 1917, during the height of World War I, the British intercepted a German telegram (the Zimmermann Telegram) that was meant for the Mexican government. The Germans called for unrestricted submarine warfare, which violated a previous agreement with the United States, and proposed that if Mexico invaded the United States, Mexico would receive United States territory at the end of the war.
In high school history classes, we are told that as soon the British caught word of this duplicitous German telegram, the United States' government was immediately notified. However, as Singh explains in the third chapter of The Code Book, the British initially withheld the information, at the potential cost of American lives due to unrestricted submarine warfare, in order to protect the cryptographic advancements of the British. At first, I thought that the actions of the British were wrong. The lives of innocent people were on the line. Yet, I realize that from a broader perspective, the move to protect British cryptographic intelligence was ethical and necessary, because in the end, it led to the demise of the Germans and to the end of the war.
If the British had immediately informed the American government of the Zimmermann Telegram, chances are the United States would have publicly condemned Germany for its actions. The success of the British codebreakers would have become known, and the Germans would have realized that their ciphers would need improving. Had the Germans known this, they could have created a better, more impenetrable cipher, and the Allies would have been back at square one. Since the Germans were unaware that their cipher had been broken (they believed that the Mexican government had handed over the telegram to the United States), the Allies had an upper hand, because they now knew the German code.
Overall, the British decision was ethical, because in the grand scheme of the war, more lives were saved by defeating the Germans than lives that would have been lost from unrestricted submarine warfare. By protecting British cryptographic intelligence, Germany was blindsided and fell behind in their cryptographic advancements. Because of this, Germany lost yet another advantage in the war.