Because the 0 is the cold temperature characteristic of the oil. Majority of your wear happens on cold start-up. Because this is a lighter oil, it flows quicker and lubricates quicker upon start up. The 40 is when the temperature is when the engine is warm/hot.
I have a friend that works for an oil analysis company and he tested many different oils on his 350Z. He has been using 0W40 now for a while and notices how drastically the wear went down from previously using 5W30 and 10W30. He ran through so many oil analysis and found 0W40 to be the best.