Keynesian economics aside, the way you spend the money matters a lot if you want to have a substainable recovery.
So the WW2 deficit spending turned out to be a great investment, not to mention the fact that we were fighting for our lives. The money Obama spent on his "stimulus package", by contrast, was almost entirely wasted. We might just as well have people digging holes and refilling them. While any amount of spending will provide some temporary stimulus, had the money been spent wisely, it might have actually pumped up our economy over the long term. Sadly, that was not the case. As ever seems to be the case with Obama, the funds were allocated according to politics rather than need or opportunity.