Galileo was facing some stiff odds when he published his Dialogue Concerning the Two Chief Systems of the World. He'd already been officially warned against heliocentrism, and he had enemies. But it's possible, just possible, that he would have squeaked by if he hadn't been a jerk to the Pope.
The feud between Galileo and the Catholic Church - the one that resulted in Galileo spending the last years of his life under house arrest - is perhaps the most well-known part of his history. Galileo was tried, threatened with torture, and forced to recant his perfectly correct position about the solar system being centered around the sun, instead of around the earth. What isn't as well known is the fact that Galileo was greatly supported by the Church up until he published this book, and was a particular friend of the reigning Pope at the time of his trial. What hung Galileo out to dry might very well not have been his intellectual position, but his attitude.
During much of his life Galileo was not particularly interested in Copernicanism, the idea that the earth orbited around the sun instead of the other way around. Born in 1564, and hailed as a genius from an early age, it wasn't until he in his late forties that he got around to advocating the idea. Even then, he did so only in letters, and so when he went to Rome in 1615, he did so to voluntarily defend his unpublished ideas. He was warned privately not to pursue the matter, and the Inquisition sent out a special Injunction telling him not to hold or argue for Copernicanism, which the Inquisition declared contrary to Scripture. Galileo dropped the matter.
But times changed, and Popes changed with them. In 1623, Cardinal Maffeo Barberini became Pope Urban VIII. Barbarini had met Galileo at a dinner in 1611, where he delighted in the sharp arguments Galileo made to completely destroy those who debated his ideas. This was just after Galileo had come by a new telescope, which allowed him to pick out the universe in more detail than anyone had before, and before the Injunction, so he very well might have discussed his heliocentrist ideas with Barberini at the time. The two men maintained a friendship that endured for over ten years. When Barbarini became Pope, Galileo met with him personally to take up the matter of Copernicanism again.
The two discussed the idea, and how it affected scripture. Barbarini, in the position to appear magnanimous and fair-minded, formally granted Galileo to write about the theory. Mindful of the political climate, Galileo did not suggest a polemic. Instead of an argument, the idea would be presented as a dialog in which characters discussed the two ideas and compared their merits.
Dialogue Concerning the Two Chief Systems of the World came out a decade later, and became a huge success in intellectual circles. It was exactly what it was promised to be, a dialog about the two ideas. Then someone noticed something. The advocate for Copernicanism was smart and well-spoken, while the one that espoused the Aristotelian geocentric view of the solar system came off as stupid and pigheaded. Well, authors always find a way to show their intentions, and it might have ended there if people hadn't noticed that the feeble-minded geocentrist used some of the same arguments that the Pope had made during his discussions with Galileo. In some cases, he even used direct quotes of what the Pope had said. And just to underline his authorial intentions, Galileo named the geocentrist 'Simplicio' - the Simpleton.
The friendship that Galileo had enjoyed was broken, with a vengeance. He was hauled into Rome and brought before Inquisition, this time not of his own accord. The private warning, and the official Injunction that had been given to him in 1616, were brought forward, and things were looking bleak. Galileo defended himself with technicalities. Although the Injunction had been issued, it had not been signed or properly processed (even in the 1600s, all court systems had bureaucracy). While it was true, he said, that he did discuss Copernicanism, his book was an examination of both sides and so he was technically not 'arguing in favor of it.' While these arguments were technically true, the Church would have been more inclined to come down in favor of technicalities in the case of someone who had refrained from publicly calling the Pope a dummy.
It was not technicalities that saved Galileo, but whatever powerful friends he had left and his own celebrity status. Galileo clung to technicalities, and insisted that he did not remember the earlier informal warnings not to 'hold or argue' heliocentrism. The counsel before which he appeared debated the possible punishments, before deciding that he should be "condemned to imprisonment at the pleasure of the Holy Congregation." The Pope, still smarting, resisted all efforts to end Galileo's house arrest, even towards the end of the man's life. He also demanded a public renunciation, during which he probably smiled and muttered, "Who's Simplicio now?"