He was sentenced to only 10 years, as opposed to much longer sentences handed to the other members of the Spandau Seven.
For a start Dönitz was not charged for Crimes against humanity, only two people charged with this escaped death, Schirach and Speer.
Secondly much of Dönitz's trail was focused around his policy of unrestricted submarine warfare. However the US had done the same to Japan in the Pacific to avoid hypocrisy while he was found guilty of the policy it was not accessed in his sentencing.
Karl Doenitz was a naval officer. He had very little to do with the behind the scenes work of Nazi Germany. The prosecution was not able to get him on anything that had to do with concentration camps or the poor treatment of non-combatants (crimes against humanity). They did not get him on that charge.
His role in the rearmament was minimal. At the time he was head of the U-boat arm and never Grand Admiral of the navy. Due to that fact, there was not much to get him on for conspiracy.
The evidence around him about crimes against the peace was vague and minimal. The prosecution could not prove he had a large role in the planning and invasions of other countries.
For the last indictment, war crimes, they had the most evidence around Doenitz. They provided lots of information saying Doenitz gave the green light to his U-boat commanders to not pick up survivors of other nations and attack neutral ships. However, two events worked out extremely well for Doenitz. The prosecution centered a large part of their case around The Laconia Order. The order was made and given by Doenitz. It allowed for U-boats to basically disregard survivors of sunken enemy ships. You might think this would make him guilty, but in reality it did the opposite. The defense used the argument that up until that point Doenitz had followed the laws of war and he gave that order because while towing survivors back to shore, the Americans bombed the German U-boat doing the towing.
In addition, the IMT allowed for a tu quoque defense (You did this too, so it isn't wrong if I do it) because Admiral Chester Nimitz of the US navy provided a written affidavit stating he had done many of the same things Doenitz is being accused of)