Part of the explanation is that the aftershock of Lehman's failure jarred Paulson and Benanke sufficiently that any worry about moral hazard was pushed away. More important, however, was the impact on Congress, which made it possible to get the TARP passed.
In the months between Bear Stearns and Lehman Brothers, Mr. Paulson and Mr. Bernanke had approached Congressional leaders about the need to pass legislation that would give them a handful of additional tools to help them deal with a larger crisis, should one ensue. But they quickly realized there was simply no political will to get anything done. After Lehman, however, Mr. Paulson and Mr. Bernanke were able to persuade Congress to pass a bill that gave the Treasury Department $700 billion in potential bailout money — which Mr. Paulson then used to shore up the system, and help ease the crisis. Even then, it wasn’t easy; it took two tries in the House to pass the legislation. Without the crisis prompted by the Lehman default, it would have been impossible to pass a bill like that.
In a sense, Lehman's collapse was like Pearl Harbor. Despite the Nazis trying to take over the world Congress would not allow the US to enter the war. Pearl Harbor shocked the political system sufficiently to get the US to enter in time.