Up until today I'd thought that it was because of the "communist threat," and Nixon/McCarthy had added it to try to find Russian spies' schoolchildren. However, after I looked the history behind it up, I can't find any credible evidence for that theory. Am I looking in all of the wrong places, or is the only reason I'd ever heard behind the change completely fabricated?
(Also, I know Nixon wasn't president at the time of the change, just that type of ideology)
The Knights of Colombus, a Catholic Christian organization, created a version of The Pledge of Allegiance with the words 'under God' directly following 'one nation'. They, as a Christian organization, thought it proper to add it to The Pledge of Allegiance, so they wrote and used their influence (They are a large and influential organization, even Pope John Paul II commended their work) to get the revision added.
The amended version was incorporated in June 14th, 1954. President Eisenhower said the following, referencing the Knights of Colombus;
“We are particularly thankful to you for your part in the movement to have the words ‘under God’ added to our Pledge of Allegiance. These words will remind Americans that despite our great physical strength we must remain humble. They will help us to keep constantly in our minds and hearts the spiritual and moral principles which alone give dignity to man, and upon which our way of life is founded. For the contribution which your organization has made to this cause, we must be genuinely grateful.”
The Knights of Colombus' page about how it happened: http://www.kofc.org/un/en/resources/communications/pledgeAllegiance.pdf
Pope's praise for their organization: http://www.catholicnewsagency.com/news/knights-of-columbus-leaders-praise-john-paul-iis-legacy-to-worlds-laity/