Dönitz, the lead Admiral in charge of the U-boat fleets did take major steps in assuring its security and limited overall exposure. Often printing schedules on water-soluble inks that would be erased during exposure to waters or in case the ships were sunk. They also changed keys and incorporated many upgrades to the initial model of the enigma which lead them to believe that even if the British captured a model, that the keys would be changed and any effort in cracking the code would lead to that code being made obsolete.
The German high command would often rule against the idea of the Enigma code being compromised when several destroyers were sunk in Norway. Even when U-570 was captured by the British, the Germans believed the crew were able to destroy any documents leading to to their code being compromised.
Dönitz believed that any success the allies had in pinpointing the exact location as well as the size of the wolfpack fleets was simply due to direction finding with the English radar systems. In 1944, after downing an allied bomber that contained the first version of smaller radar called a Cavity magnetron outfitted for air defense, led the Germans to believe that radar was the key for all the allies success. By 1945, the Enigma was so compromised that the allies could decipher it within a day. Still the Germans believed their machine was superior.
The English also took steps to make it seem like they didn't know absolutely everything about the size of fleets and their escorts. In the instance of the sinking of the Bismarck, the British fleet also went after 6 supporting vessels and sank all but the Gedania and the scout Gonzenheim flee as to not sink so many German ships in one week that it might tip the Germans off that their code was indeed broken.
Even with the code broken, the allies couldn't make use of all the information they intercepted, for instance, at the Battle of Kasserine pass, the allies knew where Rommel would be but the Americans didn't properly appreciate this information and were defeated.
To answer your question, the Germans believed so highly in their technology, that their own hubris didn't allow them to acknowledge the fact that even though the allies knew their exact size of their wolfpack fleets, they couldn't acknowledge that the enigma was cracked. Even though they were suspicious, these suspicions ultimately were pinned on radar and direction finding by allied forces.