The trouble with religion is that it is many things, that it can be understood in many different ways, so it is very difficult to say anything unequivocal about it. This applies to religion in general, and to specific religions like Christianity, Judaism and Islam.
Recently I quoted some unequivocal remarks of a negative nature which Ernest Renan made about Islam (see 'Europe and Islam'). This 19th-century historian of religion and Semitic languages had an unfortunate penchant for rhetorical excess and did not restrict his negative remarks to Islam. He referred to the Pentateuch (the early books of the Old Testament) as "the first code of religious terrorism in history." Though he did praise certain later books of the Hebrew Bible, in which he saw the beginnings of a new, purified religion, I doubt that he had many Jewish friends. (Or any Muslim ones!)
One reason why it is difficult to talk in a sensible way about religion relates to semantics. Any common noun is defined by use - it does not necessarily have a meaning which it is possible to define precisely. I won't go into the intricacies of this idea, which Wittgenstein elaborated in his later writings, because I think it is relatively uncontroversial and really quite simple. We tend to think sometimes that, if there is a word, there should be a precise concept 'behind' that word. But this is not so. Think of the word 'game', and the numerous activities that may be described as games, from football to solitaire. What essential features do they have in common?
Likewise with religion: the traditions we call religions or denominations can be very different from one another and don't necessarily share an essential element. For example, there is a world of difference between someone who identifies as a liberal Protestant and who doesn't commit to any specific doctrines, and an evangelical Christian who believes in the literal truth of the book of Genesis, etc.
Another problem is that religion is intensely personal and bound up with self-image and identity. So an attack on a particular religion or set of beliefs can be (felt as) an attack on a person or people, though it is not meant as such.
The situation here is not dissimilar to that involving strongly held political views, and indeed some ideologies operate in a similar way to religions.
I have a broadly scientific view of the world in that I think the only justified beliefs are those for which there is empirical evidence of some kind. I recognize, however, that we have a propensity - maybe even a need - to believe things which go beyond reason and evidence.
Renan, for instance, valued science and renounced the idea of a personal God and all religious dogmas, but he retained a strong belief in something very like what Christians call providence. In a striking image, he compares us to operators at the Gobelins tapestry works in Paris, weaving the reverse side of a tapestry we do not see. This belief in the benevolent 'Machiavellianism' of nature leads to a sense of acceptance, a Stoic commitment to conform to nature's purpose. Like Hegel and other idealists, he believed that humanity is moving forward towards perfection through a succession of imperfect forms. Renan was astute enough, however, to see that human progress is no simple, straightforward matter, and spoke of 'oscillations', each advance being followed by a temporary setback.
In my view, Renan was right to reject dogmatic and institutional religion and to value science. But his metaphysical beliefs about nature's purpose, etc., while not incompatible with science and reason, strike me as wishful thinking, a comforting fantasy.