Ernest Hemingway was raised a Congregationalist, and the independence inherent in that religion stayed with him throughout his life. What didn't appear to have stayed with him was the theological underpinning of any religion. He had converted to Catholicism for his second wife, but was known as an atheist. As he quotes the Major, "all thinking men are atheists."
If anything was certain to reaffirm in Hemingway's mind the questionable (to him) assumption of a divine being, it was World War I. The inexplicable brutality of that conflict, compounded by his being wounded, was incompatible with the notion of a benevolant Supreme Being guiding mankind and dispensing justice. The trench warfare that characterized that war, and the highly questionable motivations for its existence in the first place, cemented notion of atheism to the young aspiring author.
In "A Farewell to Arms," religion occupies a prominent role, as it is discussed between characters throughout the story. In fact, the role of the priest seems to be as a sounding board for theological discussions intended to question the underlying tenets of organized religion, as in Catherine's statement to Henry that "You're my religion. You're all I've got." Catherine, either an atheist or an agnostic, puts her faith solely in her fellow human beings. Similarly, Henry's references to religious practices are largely ceremonial without any deep sense of conviction.
If Heminway was an atheist, however, he understood the power of religion in times of great stress or peril. That is why, as Catherine fights for her life, Hemingway has his protagonist, Henry, pray: "Please, please, dear God, don't let her die." This transition aside, however, the dominant theme of "A Farewell to Arms" is the questionable notion of divine intervention.