For as long as I can remember, there's always been one thing about action movies that has bothered me above all else: while the bad guys can do whatever they want, without worrying about who they hurt, the good guys have to catch up to the bad guys while also attempting to contain collateral damage. It seemed so unfair to me, but the good guys wouldn't be good if they hurt everyone in their wake (which is one of the reasons why the new Superman movie was so disappointing, but I digress).
In the case of German and Allied forces in World War II, we can assume, for argument's sake, that the Germans would be the "bad guys", and the Allied forces would be the "good guys." If the pattern which caused so much of my childhood angst was being followed, it should happen that fighting the good fight would be a hinderance for the Allies. However it had the exact opposite effect. The cause that the Allies were fighting for, and the conviction that they held to complete their cause, was a major factor in their success with cracking the Enigma machine.
Singh mentions himself that motivation is a driving force in cryptography: in periods of peace, cryptographic breakthroughs are so few and far between simply because there is no need for them. In the case of Allied efforts, there was much need to break the Enigma machine. Lives were being lost at an astonishingly fast rate, and without knowledge of German plans, there was little chance for the Allied troops to make any gains. Both the higher ups and the cryptanalysts themselves understood that the stakes were incredibly high, which proved to be an incredibly motivating factor.
The need for information proved to be a very beneficial asset not only motivationally but also resourcefully. Because the Enigma machine was so complex, it required not only a lot of manpower to solve, but also a lot of machinery. Though previously in history there was some hesitation to fund cryptographic efforts, the creation of Bletchley Park is proof that Allied officials saw the need for cryptanalysis as part of their war effort. It's hard to tell how much priority cryptography would have gotten had the situation not been as dire.