In an interview with CBR, one of the Watchmen screenwriters, David Hayter (who had been attached to the Watchmen film project since 2001), sheds some light on this change. According to Hayter, the change was primarily driven by pragmatic filmmaking considerations in the 2000s.
After the 9/11 attacks (2001), Hayter felt that depicting scenes of bloody, torn-apart bodies in Times Square from the psychic squid's attack in the graphic novel would be too disturbing for audiences.
That was a difficult time to end a movie with scenes of bloody torn-apart bodies just littering Times Square.
Hayter chose to make the cut "not only for the studio's sake, but in empathy with the rest of America and the world."
Initially, Hayter changed Ozymandias' plan to use "accelerated solar power to direct [weaponized] beams of light [at New York]", but admitted this made the character seem more overtly villainous. It was only when director Paul Greengrass (who was attached to the project before Zack Snyder) came on board that Hayter hit upon using Dr. Manhattan as the perceived threat. As he explained:
The goal was: can we really find something already written into the story that's an element of power that can be used as a weapon of mass destruction and bring us to the same story elements that make the ending so amazing in the book? Eventually, that became Doctor Manhattan.
Greengrass was receptive to this idea, as it preserved Ozymandias' moral ambiguity and tied into his ego and belief that he should be the most powerful being on Earth. Hayter elaborated:
If Doctor Manhattan had never existed […] Adrian would be the most powerful man in the world. But once Doctor Manhattan comes along, he's the most powerful insect in the world. There's no comparison. So, what Paul loved was that Adrian, by using Doctor Manhattan as his weapon, puts himself back on top.
Dave Gibbons, the artist who drew the original graphic novel, endorsed the changed ending as being dramatically appropriate for a film adaptation:
I think the ending they put on it is a really appropriate ending, and, actually, they haven't just plopped a different ending on and ripped the squid out. It actually ties back into the story and makes tremendous sense in the dramatic development of the story in way that the Squid wouldn't [for a film].
I think the ending is true to graphic novel; it's the same sense of has [Adrian] done the right thing? There's the moral ambiguity. There's the crisis of cultures that it gives to all the main characters. And that remains intact. So I'm perfectly happy with it.
While a major change from the source material, the movie's ending was carefully considered to maintain the core narrative, themes, and character motivations of the graphic novel in a way that would work better for a 2000s film adaptation.
The post-9/11 desire to avoid depicting bloody, torn-apart bodies was the initial impetus, but using Dr. Manhattan emerged as a thematically resonant solution.
Source: THE SQUID IN THE PICTURE: Watchmen's Biggest Change. CBR