Let me begin answering this question by first sketching out definitions of science and religion. By science I mean a concept of the universe built up by inductive reasoning and analysis of theory based on statistical interpretation of empirical data. I think that this short definition covers most of the principles of modern science.
Religion, on the other hand, will require more explaining, but I hope I can give a definition that is both broad enough as not to cause disagreement, but precise enough to be useful. My definition cleaves religion in two: on one side is the personal religion, with belief in deities, spirituality, one-to-one relationships with god, and so on; on the other side is communal religion, including places of worship, family ties, dogma, and religious education. Organised religion forms a large part of this, but communal religion includes other aspects, such as familial and interpersonal relationships. What is common to both is that they provide some direction as to a ‘way of life’ that the religious are to follow, and they provide a specific worldview that goes along with that way of living.
Let me start with the relationship between communal religion and science. It is tempting to draw meaning from their coexistence throughout history (12th Century Islam and the early Greek city-states are common examples), however this could be quite misleading. The question we could ask is whether there is a statistical link at all between cultures and suppression of science. Certain cultures and communities were accommodating to science, but that’s not to say that all were. A historical trend can also be observed of societies that had scientifically stagnated, and actively oppressed science; see 16th century Catholicism in the suppression of Copernicus and his heliocentric model of the solar system.
More irksome still is the fact that it is very difficult to do comparative study within history, as religion was so prevalent that it is almost impossible to find a society that had no religion, to compare scientific advance. Only a handful of cultures throughout history have lived without some sort of religion as a cultural mainstream, and all within the last hundred years, so the relationship between religion and science is a difficult one to determine: much easier links can be drawn from population growth or the progressive nature of science, and these both give out too much statistical noise to allow the data to be useful. The answer to whether there is a link is inevitably muddled, and I do not believe that the answer will come from historical analysis.
So I will abandon the scientific approach for a philosophical one: does the nature of science conflict with the nature of religion? What is the nature of communal religion? On the face of it, communal religion is a very practical operation: shared religious belief strengthens the bonds of a community to the point that the needs of the collective become more important than the needs of the individual. Many religions, and the moral systems that go along with them, share this feature, and for a good reason- a strongly-linked community is one that can survive the course of time and of hardship.
In its way, it is almost like an evolutionary adaptation of the community to times of stress, when other communities might fail because their members act out of self-interest. This strength can keep communities together regardless of social or geographical barriers, and by community, I mean a group of people, and the set of shared ideals that allow them to live in relative harmony with each other, involving some sort of interactive community life in which every member participates.
In many religions, also, much emphasis is placed on the followers of the particular religion as opposed to the ‘unbelievers’. Although the statement may initially seem objectionable in this context, the discrimination need not involve just negative attitudes towards others. More commonly, it takes the form of the ‘blood is thicker than water’-type arrangements: individuals are pressured by the community, consciously or subconsciously, to help members of the community in preference to the complete stranger or otherwise unconnected people. This is a general feature of any community, but with religious backing the level of persuasion hinges on moral and traditional grounds, amplifying the strength of the preference.
To the religious community, primacy of itself is paramount as we have seen; however, this is not something science can support. For science, the only thing that separates belief from rejection is empirical data. A religious community is entirely based on the way of life and the viewpoint that comes with it. The ideas the community is based on are axiomatic, and community life revolves around expression of these ‘truths’, irrespective of the rationale behind these axioms, so any empirical claims must be analysed with reference to the axioms.
If individuals begin to reject the truth, and therefore the community itself, the punishment is their rejection from the community in some form or another, for example economic, social or intellectual excommunication. I would like to note that this does not necessarily reflect ‘good’ or ‘bad’ community ideals: this simply reflects what communities tend to do. Both irrational and rational ideas can arise which can be conflicting or non-conflicting, and these can be absorbed into religious communities, which then can become a basis for a practical operations between people, and cannot easily be eliminated by thought alone.
In this way the scientific principles can be distorted when observed results are not accepted, based on some earlier ideal which has become entrenched in the way of life of the community. The thinking is not free, and thus not scientific, because it is bound in some ways by the principles of what has come before.
I feel that perhaps we have begun to find our philosophical contradiction between the two disciplines: the dynamic nature of science appears to be in direct conflict with the conservative aspect of communal religion. The community simply places to much intellectual weight on the interest of their own ideals, rather than allowing the scientist the freedom of generalisation, of considering alternate possibilities to test and experiment, even the possibility of the community being wrong in one of its ideals.
Now onto personal religion: what this would generally entail is a short description of spirituality, linked with the mythology and language of a group of people. For brevity, I shan’t go into that argument, but rather leave you with the excellent exploration of it given by Carl Sagan in his book ‘The Demon-Haunted World’:
“Science is not only compatible with spirituality; it is a profound source of spirituality. When we recognize our place in an immensity of light‐years and in the passage of ages, when we grasp the intricacy, beauty, and subtlety of life, then that soaring feeling, that sense of elation and humility combined, is surely spiritual […]. The notion that science and spirituality are somehow mutually exclusive does a disservice to both.” (Sagan, 1997)