James's opinion is simply an opinion, but that doesn't mean that it does not have serious merit. Although he is correct to observe that religion has dubious, unknown origins, and although he correctly understands that religious experience is a mode of normal experience, he sometimes forgets that perhaps religion might have some actual truth to offer in a mystic or mythic way.
To a person who has read Jung's theories about Christianity, or who has read Joseph Campbell's analysis of religion, James's writings might seem short-sighted and archaic, but that's because this book is over a hundred years old. Essentially, what this book provides is an accurate diagnosis of human neurosis around religion. Of course, it's controversial and difficult to say the scary truth about religious experience, because (so far on the earth at least) religion is universal. To say "Religion is basically just how you interpret your experience of self," is universally offensive (especially in James's time; this was published in 1902 after all, before the World Wars, before the existentialists, before the logical positivists, etc.).
James argues that since religion is misunderstood, that it should be eliminated, and that's where his theory has fallen to the most criticism. Although religion is misunderstood by religious people, it is still a fact of our animal nature. After all, humans all across the earth developed their own religions without being told to do it, which shows that it is an essential part of what it means to be alive, and what it means to be human.
James's theory is perfectly compatible with true religious mysticism, because mystics already believe that fundamental religious folks have misunderstood the nature of religious truth, but as James notes, mysticism derived from drug experiences is misguided and dangerous, because humans can always interpret their experience through religion.