The Galileo affair is usually told as science against religion, with the church on the side of ignorance. The real story is stranger. The evidence was less settled than the legend says, the argument about the Bible was more careful, and the trial had as much to do with a pope's pride as with the planets.
Four things get attached to Galileo that did not happen, or did not happen that way.
That the church thought the earth was flat. Educated Europeans had known it was a sphere since antiquity. The question was whether the earth or the sun sits at the centre, and whether the earth moves.
That Galileo was tortured and thrown in a dungeon. He was threatened with torture, as procedure required, but not tortured. He spent the trial in comfortable rooms and his sentence as house arrest at his own villa.
That he muttered "And yet it moves" as he left the court. The line first appears in print in 1757, more than a century after his death.
That it was a simple clash between evidence and dogma. In 1633 the evidence did not yet settle the question, and both sides knew it.
Three questions were tangled together.
What the evidence showed. Galileo's telescope (1610) found moons orbiting Jupiter and phases of Venus. These ruined the old earth-centred system of Ptolemy. They did not prove Copernicus right, because the system of Tycho Brahe, in which the planets circle the sun and the sun circles a still earth, fitted the same observations. The direct proof that the earth moves, the shifting of nearby stars as the earth orbits (stellar parallax), was not measured until 1838.
Who may interpret Scripture. Verses like Joshua 10:12–13 and Psalm 104:5 speak of the sun moving and the earth fixed. Galileo argued, in his Letter to the Grand Duchess Christina (1615), that the Bible speaks in the language of ordinary appearance and is meant to teach "how one goes to heaven, not how the heavens go". Many churchmen agreed in principle. But after the Reformation, Rome was deeply wary of laymen reinterpreting Scripture on their own authority.
A broken promise and an insulted pope. In 1616 Galileo had been told not to hold or defend Copernicanism as true. His Dialogue (1632) did exactly that, and put an argument of Pope Urban VIII, who had been his friend and patron, in the mouth of a character called Simplicio. The trial was about disobedience as much as astronomy.
Each stated as its holders would have stated it.
Galileo Galilei, and a minority of astronomers
Copernicus described how the heavens actually are, not just a convenient way of calculating them. Where Scripture seems to say otherwise, it is speaking as things appear.
Why they held it Because his telescope had broken the old system, and because he believed truth cannot contradict truth: God wrote both the book of Scripture and the book of nature.
Cardinal Robert Bellarmine, in his letter to Foscarini (1615)
Copernicus may be used as a model that saves the appearances. If it were ever truly demonstrated, the church would have to reinterpret the passages that seem to contradict it, carefully. But it has not been demonstrated.
Why they held it Because the plain sense of Scripture, read the same way by the church fathers, should not be set aside for an unproven theory.
Followers of Tycho Brahe, including many Jesuit astronomers
The planets go round the sun, and the sun and moon go round a stationary earth.
Why they held it Because it fitted every telescopic observation then available, including the phases of Venus, and needed no motion of the earth, which nobody could detect.
The condemnation came fast. The retreat from it took centuries.
Because the same tangle keeps returning. When a claim about nature and a reading of Scripture seem to collide, it helps to separate the questions the way Galileo's case did not: what does the evidence actually show yet, what is the text actually claiming, and who is being trusted to decide.