From Wikipedia
Irving Berlin wrote the song in 1918 while serving the U.S. Army at Camp Upton in Yaphank, New York, but decided that it did not fit in a revue called Yip Yip Yaphank, so he set it aside. The lyrics at that time included the line "Make her victorious on land and foam, God bless America..."[3] as well as "Stand beside her and guide her to the right with the light from above".[4]