Contrary to the views of modern militant atheists, science and religion have not been locked in an eternal and unavoidable conflict. They certainly came into conflict in the early modern period--Galileo's trial for heresy in 1633 is only the most famous instance of this--but they very often worked together in a harmonious way. Religion contributed to the rise of modern science for the simple reason that it was a ubiquitous and well-resourced institution. It was also an institution in flux in the early modern period, one that changed as dramatically as natural knowledge did. The Protestant Reformation swept through Europe, causing bloodshed and elation in equal measure. The Counter-Reformation was as vigorous as its Protestant rival, and nearly as innovative. Science met the Counter-Reformation head-on in Galileo's stand-off with the Church. But Galileo was no atheist, and he hoped to harmonize science and religion rather than opposing them.
Henry, John. The Scientific Revolution and the Origins of Modern Science, chapter 6.
McMullin, Ernan, 'Galileo on Science and Scripture,' in Peter Machamer, Cambridge Companion to Galileo (Cambridge UP, 2006) - ebook, read pages 277-296 to get the context of Galileo's Letter
Galilei, Galileo. Letter to the Grand Duchess Christina of Tuscany (Tuscany, 1615) - available online here
What was the context for Galileo's Letter?
What was he arguing for?
How does he make his case?
Further reading - general
Feldhay, Rivka. ‘Religion’. In CHS3.
Funkenstein, Amos. Theology and the Scientific Imagination: From the Middle Ages to the Seventeenth Century. Princeton University Press, 1986.
Grant, Edward. God and Reason in the Middle Ages. Cambridge: Cambridge University Press, 2001.
Harrison, Peter, ed. The Cambridge Companion to Science and Religion. Cambridge Companions to Religion. Cambridge: Cambridge University Press, 2010.
Hooykaas, Reijer. Religion and the Rise of Modern Science. Edinburgh: Scottish Academic Press, 1972.
Lindberg, David C., and Ronald L. Numbers, eds. God and Nature: Historical Essays on the Encounter Between Christianity and Science. Berkeley: University of California Press, 1986.
Westfall, Richard. Science and Religion in Seventeenth-Century England.New Haven: Yale University Press, 1958.
Further reading - specific
Feingold, Mordechai. Jesuit Science and the Republic of Letters. 2003
Harrison, Peter. The Bible, Protestantism, and the Rise of Natural Science. 1998
———. The Fall of Man and the Foundations of Science. Cambridge: Cambridge University Press, 2009.
Heilbron, J. L, ‘Science in the Church’, Science in Context, 3 (1989), 9–28
Heilbron, John. The Sun in the Church: Cathedrals as Solar Observatories. 1999
Heilbron, John. Galileo. 2010, esp. ch. 7, on the circumstance of Galileo's 1633 trial
Kusukawa, Sachiko. The Transformation of Natural Philosophy: The Case of Philip Melanchthon. 1995
Quiong, Making the New World Thier Own: Encounters with Jesuit Science in the Age of Discovery. 2015