I'm going to start this with a disclaimer: Dönitz was an ardent anti-Semite and supporter of the Nazi regime. While I would agree that his light sentencing for ordinary war crimes only was relatively just, that is absolutely not an assertion that his direct approval of Nazi policy (including the Holocaust) is an any way justified and does not exonerate him for his indirect support of crimes against humanity. In other words, while Dönitz didn't commit terrible atrocities or order them himself, his political support and acceptance of command in the Nazi war apparatus still constitutes an enabling of such crimes.
Nimitz was, in fact, compelled to write the affidavit by a government body - the United States government or the Allied Control Council, depending on how you look at it. He didn't submit it as an amicus curiae brief of his own accord but was answering an interrogatory issued to him by the Nuremberg tribunal court. The interrogatory was submitted by, and its issuance permitted by, significant legal maneuvering by Dönitz's defense lawyer, Otto Kranzbühler.
Kranzbühler was one of the more successful German lawyers at Nuremburg; Dönitz ended up being acquitted on Count One (conspiracy to commit crimes against peace), convicted on Count Two (planning, initiating, and waging wars of aggression), and convicted of some but not all charges of Count Three (crimes against the laws of war). He was not charged on Count Four (crimes against humanity).
Kranzbühler's defense for the unrestricted submarine warfare portion of the Count Three indictment was constructed as follows:
1) International law is defined by custom and practice as much as written agreement.
He quoted Chief Prosecutor Jackson here: "International law is not capable of development by legislation, for there is no continuously sitting international legislature. Innovations and revisions in international law are brought about by the action of governments, designed to meet a change in circumstances. It grows, as did the common law, through decisions reached from time to time in adapting settled principles to new situations."
2) Unrestricted submarine warfare was practiced and justified by the United States and especially by Britain.
His defense goes in-depth on descriptions of British and US resolutions, statements by political and military leaders, and summaries of the actual practice of their militaries. He sums up the developing attitudes:
"An insular power like Great Britain having long and vulnerable sea lanes, has always looked upon these questions from a different angle than the continental powers. The attitude of the United States from the renunciation of submarine warfare by the Root Resolution of 1922 to unrestricted submarine warfare against Japan in 1941, reveals how a change in strategic position can entail a change in legal evaluation.
3) Dönitz's practice of submarine warfare was in line with the Allies', a military necessity, and not needlessly cruel.
The first part of this is covered in his lengthy descriptions mentioned above, description of the German practice, and by comparing orders issued by Dönitz and Allied powers. His justification for military necessity rests on the arming of merchant ships, merchant ships opening fire on spotted submarines, total nature of the war, and the practice of merchant ships calling in air strikes and military vessels by radio - "nowadays a naval war is not directed by letters but by wireless;" or in other words, that any ship equipped with a radio and coordinating with an enemy military to conduct operations is a serious threat and therefore effectively a legitimate military target.
As for the charge that Dönitz ordered U-boats to not pick up survivors, Kranzbühler pointed to an incident in which German submarines were bombed by an Allied bomber during rescue operations after an attack (the bomber having been alerted by the merchant vessel over radio) and that submarines have difficulty rescuing survivors while maintaining their own safety and maintaining operational effectiveness. (Specifically, that they are vulnerable while towing lifeboats on the surface, have little extra space and rations for passengers, and that the small numbers of an individual operational group means one ship leaving to depart to shore drastically reduces the operational effectiveness of the group). He also pointed to similar standing orders for Allied submarines as evidence that this order was in line with common practice and had the same reasoning behind it.
4) Therefore, Dönitz's orders regarding unrestricted submarine warfare were in line with international law as practiced by all belligerents and not a crime against the laws of war.
Proving that the US Navy engaged in unrestricted submarine warfare comparable to Germany's, and that their military and legal reasoning was similar, was crucial to all points of this defense. Kranzbühler outlined this reasoning when justifying the submission of the interrogatory to Nimitz on day seventy-four of the trials:
I now turn to the application regarding the interrogatory to be put to Admiral Nimitz. The stand taken by the Prosecution [that the defense intends to argue the US broke international law, which is tu quoque argument and irrelevant to the trial] differs entirely from the conception on which my application is based. I in no way wish to prove or even to maintain that the American Admiralty in its U-boat warfare against Japan broke international law. On the contrary, I am of the opinion that it acted strictly in accordance with international law. In the United States' sea war against Japan, the same question arises as in Germany's sea war against England, namely the scope and interpretation of the London Submarine Agreement of 1930. The United States and Japan were also signatories to this agreement.
My point is that, because of the order to merchant vessels to offer resistance, the London Agreement is no longer applicable to such merchantmen; further, that it was not applicable in declared operational zones in which a general warning had been given to all vessels, thus making an individual warning unnecessary before the attack.
Through the interrogatory to Admiral Nimitz I want to establish that the American Admiralty in practice interpreted the London Agreement in exactly the same way as the German Admiralty, and thus prove that the German conduct of sea warfare was perfectly legal. The same applies to the treatment of shipwrecked persons in waters where the U-boat would endanger herself by rescue measures.
This was an exceptionally clever strategy. On its own, it's a solid legal argument, but it had a lot more going for it than that.
While the court had ruled that Germans could not defend war crimes by pointing to war crimes committed by the Allies, Kranzbühler sidestepped these rules by pointing to actions of the Allies and then arguing their legality. It also put the Tribunal in the position of either tacitly acknowledging Allied war crimes or rejecting what was not only a very solid defense of German submarine warfare, but also one justifying Allied unrestricted submarine warfare. As it turns out, they split the difference, as described further down.
Kranzbühler told his understanding of the importance of, and difficulty getting, the interrogatory accepted in an interview for Court TV's Nuremberg documentary:
At the American library I got a little pocketbook about the Pacific war. And I read it and, of course, I had the idea, they had done exactly what we had done. I discussed it with Dönitz and he was enthusiastic about it, and then we made this questionnaire which we asked Nimitz to answer. But it wasn't as easy... there was, of course, strong opposition by the prosecution and typical for Nuremberg, there was not a discussion in open court, things like that. We had it in private, no camera, there was only with the judges, prosecutors, and me. And then I had to defend my reasons, and was attacked by [Allied prosecutor] Sir David Maxwell-Fyfe who said, "Well we have [?] Germans, the American Navy has nothing to do with it" and all that. But, uh, the judge who really supported me was Biddle, the American judge, who insists [sic] that this questionnaire was given to Admiral Nimitz and of course it was a big success to have it answered the way it was."
He proved to be correct in his assessment of the Nimitz testimony. Nimitz's response to the questionnaire described the conduct of unrestricted submarine warfare and reasoning behind it thoroughly and in such a way that it was effectively a defense of identical German practices. The only significant difference, and one that was noted by the Tribunal, was that Dönitz gave a blanket order forbidding rescue of survivors whereas the US order specified that it was forbidden only where it put US submarines at risk.
The Tribunal ruled that attacking vessels with full knowledge that rescue would be impossible was a crime. However, it also openly stated in its judgment of Dönitz that "in view of all the facts proved and in particular of an order of the British Admiralty announced on the 8th May, 1940, according to which all vessels should be sunk at sight in the Skagerrak, and the answers to interrogatories by Admiral Nimitz stating that unrestricted submarine warfare was carried on in the Pacific Ocean by the United States from the first day that nation entered the war, the sentence of Doenitz is not assessed on the ground of his breaches of the international law of submarine warfare."
Now as to why Nimitz answered the questions in the way that he did, I'm unable to find a source in which he specifies that. (If anyone reading this has a biography of Nimitz handy, that might have it).
Kranzbühler, however, speculates.
No [I was not surprised]. I expected it. Any admiral in the navy would have done the same."