Well, not sex, exactly…or maybe in certain passages. "Song of Myself" became scandalous in some circles because of its frank discussion of sexuality, body parts, and bodily fluids. But Whitman is often so metaphorical and subtle in his discussion of sexuality that it can be hard to pin him down. For example, he uses the words "jetting" and "fatherstuff" to describe ejaculation and semen, respectively. Still, there's no question that he feels sex has gotten a bad rap in America, which after all was founded by Puritans. He believes that shame about sex is very harmful to society and that the body should be celebrated rather than feared.
Sex is not nearly as central to the poem as many critics have suggested. It is merely one metaphor for the mystical union with nature.
Whitman's goal is not to glorify sex or sexuality; he merely wants to remove the stigma of guilt attached to both.