The declaration of war helps Montag escape because it provides a bit of a diversion. His escape was made slightly easier because of it. Right before the declaration of war, Montag turns his flame thrower on Beatty and kills him when they are at Montag's house because Mildred turned in her husband for having books. Beatty kept badgering Montag, calling him an idiot and a fool and telling him that he couldn't get away. When Montag turned the flame thrower on Beatty, Beatty didn't move to get out of the way, he didn't do anything. The bigger question is why did Beatty wish to die? Beatty was obviously a well read man; he knew a great deal about books and could quote from many works. It would have been hard for him to remain unenlightened with all the reading he did. His job and all his training taught him that books were bad and that books should be banned. Earlier in the story, when Beatty is at Guy's house the day Guy doesn't go to work. Beatty says that books make people unhappy because they show people what might be, they allow people to compare themselves to others and possibly find themselves wanting. Beatty is probably talking about himself here. He tells Montag that the smart kid in school who could answer all the questions was usually the one bullied at recess and after school. Beatty was likely that child. Beatty has learned a lot from books, but rather than let that learning direct him in a more positive direction, that learning has made him depressed. Perhaps, too, Beatty has seen what their world has become and knows that annihilation is imminent. Maybe Beatty would rather die now than risk dying in the upcoming war.