At first, Kubrick intended to make a serious film, but soon decided to scrap the idea, because - rather ironically - he thought that people would laugh.
Q: Strangelove was based on a serious book, Red Alert. At what point did you decide to make it a comedy?
A: I started work on the screenplay with every intention of making the film a serious treatment of the problem of accidental nuclear war. As I kept trying to imagine the way in which things would really happen, ideas kept coming to me which I would discard because they were so ludicrous. I kept saying to myself: "I can't do this. People will laugh." But after a month or so I began to realize that all the things I was throwing out were the things which were most truthful. After all, what could be more absurd than the very idea of two mega-powers willing to wipe out all human life because of an accident, spiced up by political differences that will seem as meaningless to people a hundred years from now as the theological conflicts of the Middle Ages appear to us today?
So it occurred to me that I was approaching the project in the wrong way. The only way to tell the story was as a black comedy or, better, a nightmare comedy, where the things you laugh at most are really the heart of the paradoxical postures that make a nuclear war possible. Most of the humor in Strangelove arises from the depiction of everyday human behavior in a nightmarish situation, like the Russian premier on the hot line who forgets the telephone number of his general staff headquarters and suggests the American President try Omsk information, or the reluctance of a U.S. officer to let a British officer smash open a Coca-Cola machine for change to phone the President about a crisis on the SAC base because of his conditioning about the sanctity of private property.
- Stanley Kubrick
Considering the fact that the movie was originally supposed to end with a pie fight, I'd say the finished product is slightly more serious than it was intended to be.
After a screening of Dr. Strangelove I cut out a final scene in which the Russians and Americans in the War Room engage in a free-for-all fight with custard pies. I decided it was farce and not consistent with the satiric tone of the rest of the film1.
- Stanley Kubrick
1 There has long been speculation that the pie fight was cut, in part, because U.S. President John F. Kennedy had been assassinated a week before the movie was scheduled to premiere (the premiere was pushed back a few months because of the assassination). In the pie fight, President Merkin Muffley is hit with a pie at one point, to which another character responds "Our beloved President has been struck down in his prime". Whether this is true or not, we do know that the original line "A fella could have a pretty good weekend in Dallas" was changed to "A fella could have a pretty good weekend in Vegas" because Kennedy was killed in Dallas, so it is, at least, plausible.