From the Wikipedia:
The Pledge of Allegiance was written in August 1892 by Francis Bellamy (1855–1931), who was a Baptist minister, a Christian socialist, and the cousin of socialist utopian novelist Edward Bellamy (1850–1898). The original “Pledge of Allegiance” was published in the September 8 issue of the popular children’s magazine The Youth’s Companion as part of the National Public-School Celebration of Columbus Day, a celebration of the 400th anniversary of Christopher Columbus’s arrival in the Americas.
Initially, it went like this: “I pledge allegiance to my Flag and the Republic for which it stands, one nation indivisible, with liberty and justice for all.”
The Pledge was supposed to be quick and to the point. Bellamy designed it to be recited in 15 seconds. As a socialist, he had initially also considered using the words equality and fraternity but decided against it – knowing that the state superintendents of education on his committee were against equality for women and African Americans…
In 1923, the National Flag Conference called for the words “my Flag” to be changed to “the Flag of the United States”, so that new immigrants would not confuse loyalties between their birth countries and the United States. The words “of America” were added a year later.
This addition does seem to make sense, as it specifies the oath. Unfortunately, as Now I Know notes, Bellamy was also responsible for the Bellamy Salute, which was…
…very similar to the traditional Roman one, which Benito Mussolini and then Adolf Hitler adopted for their own supporters. By the early 1940s, the symbolism of such a salute was not longer one of allegiance to the American flag, but rather to Nazi Germany. On December 22, 1942, the United States Congress adopted the Flag Code, dropping the Bellamy Salute from the Pledge of Allegiance, and replacing it with the instruction that the speaker place his or her right hand over his or her heart.
“I pledge allegiance to the flag of the United States of America, and to the Republic for which it stands, one Nation indivisible, with liberty and justice for all.”
The “under God” phrase wasn’t added until 1954, well after Bellamy died.