Whitman's ambivalence about religion and spirituality is a major topic of "Song of Myself." He thinks that society has surpassed organized religion with its hierarchies and rules, but his language is full of Biblical references and talk of the soul and the spirit. In a nutshell, he thinks that the body and the soul are two sides of the same coin. Contrary to the Christian doctrine that the soul is greater than the body, Whitman thinks that both body and soul are immortal because they are connected to the larger patterns of nature. "Song of Myself" is meant to be a prophetic statement, but Whitman is careful to avoid the impression that he is trying to write a new kind of scripture and to make up new rules to follow.
Whitman's ultra-egoistic persona in the poem views himself as a prophet along the lines of Jesus Christ, complete with death and resurrection.
"Song of Myself" presents a conflict between the author's obvious distrust of religious institutions and his personal requirement to avoid judging anyone and anything. He wants to judge religion.