The Catholic Church grew up alongside Western European Culture. At the time of Christanity's formation, most culturally aware people understood that the Earth was a stationary sphere at the center of a set of crystal planetary spheres inside another sphere of stars. It had all been figured out by the Greeks centuries before, particularly by a man named Ptolemy. The model had also been approved by Aristotle, and eventually proved to be a good fit with the Christian theology of the Middle Ages. There were problems with the model. Some planets changed course in their orbits, but the mechanistic minds of medieval scholars came up with solutions that they called "equant circles", smaller circles that allowed planets to appear to move faster and slower in their orbits around the Earth.
Then, in 1543, Copernicus published "De revolutionibus orbium coelestium", a treatise that proposed a simpler explanation of planetary orbits by placing the sun near the center, not the Earth. It was based on an idea by an other ancient Greek, Aristarchus, who had largely been forgotten. Copernicus's model was not perfectly heliocentric, but it was a vast improvement on the Ptolemaic system. However, it did not gain wide acceptance. There was too much invested in the motionless Earth notion that both the Bible and ordinary observation supported.
In the early 1600s, Galileo started fooling around with a telescope, discovering that Venus had phases like the moon, which had mountains and craters. When he looked at Jupiter, he was stunned to find tiny moons orbiting around it. Ptolemy said there was no space between the spheres, so how could these things work? He was forced to adopt a heliocentric system full of empty space.
Galileo got an even more hostile reception when he published his observations in 1610, but none more severe than that of Holy Mother Church. By his assertions, Galileo was undermining the order of the heavens and diminishing the importance of Earth, and of Man. His eccesiastical advocate, Robert Cardinal Bellermine, urged Galileo to treat heliocentrism as a theory, a mathematical trick to explain appearances, but Galileo wanted to be able to publish what he knew to be true. The Roman Inquisition tried him in February 1610. It was a draw. Helicentrism was condemned, but the book, while removed from circulation, was not actually banned.
Pope Gregory XV died, and the new pope, Urban VIII, seemed more friendly at first, but then became distracted by court intrigues, finally turning colder toward Galileo. Purportedly, Urban ordered Galileo to include Urban's arguments against heliocentrism in any book on the subject. Galileo published "The Dialogue" in 1632, a discussion between a Copernican, a stuffy Ptolemaicist, and a witty moderator. It was a popular hit, then it was banned because it appeared to mock the pope. In 1633, Galileo was tried and found "vehemently suspect of heresy", and was remanded to house arrest for the rest of his life.
These events started other scientists re-examining their presumptions and slowly ushering in the Age of Enlightenment. In 1758 the Catholic Church dropped the general prohibition of books advocating heliocentrism, but not the sentences of Galileo, The Dialogue, or Copernicus' works. By 1835, the books had disappeared from the Index of Forbidden Books. In 1990, Cardinal Ratzinger (our current pope) defended the Church against Galileo, saying the Church had been protecting society and ethics from the implications of Galileo's work. But in 1992, Pope John Paul II took Galileo's side, saying the Church had been too devoted to Biblical literalism. And in 2000, JPII issued a formal apology to Galileo. So far, Galileo has not responded, but a lot of academics are angry with Pope Benedict XVI.