Even in the original 1954 Godzilla (as well as the 1956 "Americanized" Godzilla: King of the Monsters) it is debatable that Godzilla is "bad". Rather, he is an uncontrolled force of nature providing a painful demonstration of the risks and dangers of nuclear technology.
However, there is a gradual shift over time to have Godzilla become more and more a "champion" of earth. This shift is then reversed with changes to the directors handling the movies.
In the second movie, 1955's Godzilla Raids Again, Godzilla is still just a relatively mindless "force of nature", who actually saves Osaka by defeating Angilas (although the collateral damage is fairly high). It is shown that lights and fire attract Godzilla, as it supposedly reminds Godzilla of the bright lights and explosion of the hydrogen bomb that woke and mutated him. This indicates that it is not necessarily any evil intent on Godzilla's part that lead to him rampaging through Tokyo Bay in the first movie.
King Kong vs. Godzilla in 1962 was little different. Both Kong and Godzilla were wild, uncontrolled forces of nature doing damage to centers of human populations, with neither really being "good".
1964's *Mothra vs. Godzilla appears to be the first where another monster is placed as the "good" opponent, as Mothra's help is solicited to defend Tokyo against yet another of Godzilla's rampages. This movie was very well received, and received the second highest box office attendance of all of the Godzilla movies.
This popular reception probably influenced the next movie, Ghidorah, the Three Headed Monster, which featured Mothra yet again, this time persuading both Godzilla and Rodan to (eventually) join forces to fight the threat from outer space.
This is the first movie to depict Godzilla as having intelligence.
However, despite Godzilla's new-found intelligence, he still remains a force of nature throughout the next few movies, varying from self-defense to alien-induced rampages.
It is not until 1968's Destroy All Monsters that Godzilla seems to deliberately act to defend earth of his own will (in Ghidorah, the Three Headed Monster, he acts more out of respect for Mothra than out of any sense of obligation or territory), attacking the alien's secret base after they lose control of him and the other monsters from earth.
From then on, Godzilla is seen more of a guardian than a terrorizing force of nature. Starting with 1972's Godzilla vs. Gigan, Godzilla is seen to actively take an interest in protecting the earth, instead of merely reacting to threats (in the 1971 Godzilla vs. the Smog Monster Godzilla comes to earth's defense, but it is implied that he blames humanity for the pollution that allowed the Smog Monster to be created).
However... this all changes with 1984's The Return of Godzilla, featuring a new director (Koji Hashimoto). This sees a return to Godzilla as the destructive, uncontrolled force of nature. Movies from this point once again feature Godzilla as something that humanity must be defended against, rather than the guardian of the planet.
This continues on until a new director, Kensho Yamashita brings us 1994's Godzilla vs. Space Godzilla, which revists the theme of Godzilla defending earth from an evil monster from outer space.
However, the next year director Takao Okawara returns with
Godzilla vs. Destroyah, and returns Godzilla to the role of rampaging, uncontrolled threat to humanity (and this time to the entire planet).
This reversal continues throughout the rest of the films (including the 1998 American remake Godzilla), up until the most recent flick, 2004's Godzilla: Final Wars, which sees Godzilla sparing the humans at the end, thanks to intervention by his son, Minilla.