In the above quotation, which is found cited in various places on the Web, Sagan pulls an old, old trick that we "religionists" should be familiar with because we (probably) invented it. I personally first became aware of it in my study of 19th century Presbyterian missionary history in Siam (a.k.a. Thailand). In their sometimes virulent attacks on Thai Buddhism, the old time missionaries would often contrast the worst of that faith with the best of their own. In much the same way, Sagan contrasts science at its best with religion at its worst.
Yes, yes, I'm saying that in this case Dr. Carl Sagan, renowned astronomer, displays the thinking of a 19th century Presbyterian missionary in Siam. More to the point, in this brief quotation at least he virtually treats science as a religion without realizing that he does so. It is for him the highest form of knowledge known to humanity and that approach to knowing that is most trustworthy. It is his faith, and like other missionaries one of the ways he affirms the ultimacy of his own faith is by pointing out the failures of other so-called ultimate faiths, such as politics and religion.