A popular narrative about Galileo and the Catholic church is it was a simply case of science versus religion, freedom of thought versus censorship and persecution, truth versus superstition, reason and evidence versus blind faith, ....
However, the reality is much more complex. This is nicely described by Lawrence Principe in his lecture course on Science and Religion. A few random points.
The greatest problem for Galileo was caused by his Dialogue of the Two Chief World Systems, which considered heliocentrism [Copernicanism] versus geocentrism [Ptolemaic]. However, mostly the booked was concerned with his theory of the tides, which was wrong. He claimed the tides were caused by water sloshing around on the earth caused by its motion, rather than by the motion of the moon [as advocated by Kepler].
Pope Urban was no imbecile and had a philosophically nuanced view of science. He was an instrumentalist, whereas Galileo was a realist. i.e. Urban considered that scientific theories could not reveal how things really are but only produce formulas for describing observations, e.g. the positions of planets.
Galileo was not tactful in his relations, particularly with Pope Urban, who was originally his friend. He was particularly prone to sarcasm. He put some of the Popes views in the words of a character Simplicio [simpleton].
The role of Vatican "censors" was not unlike modern journal editors who send articles out for review.
Galileo never went to jail. Rather, he was under "house arrest" living in a mansion, and still working.