Secondly, the admonition against Galileo WAS NOT an excommunication, but rather a censure, and the Holy Office did this to protect Galileo from radical zealots like Lorini and Caccini. It did not prevent Galileo from discussing heliocentrism hypothetically, and no such admonition was given to the Jesuits, who largely supported Galileo's findings and were free to teach them all they wanted. In effect, this was the Vatican's way of giving Galileo a firm slap on the hand. The Holy Office was effectively telling him never to play the role of theologian again, and to keep his place as a scientist.
It is quite probable that Galileo was trying to write a book that would keep his readers entertained while he simultaneously educated them. But this method, combined with the fact that he pushed heliocentrism as absolute truth again, became Galileo's undoing. The pope (Galileo's friend) was a geocentrist, and the irreverent writing style of the book made him look like an idiot. This came at a time when the Catholic Church was still reeling from the Protestant Reformation. It is unknown if the pope ever read the book, and in all probability his advisers discouraged it. The pope's defenders immediately went into action, and once Galileo was caught in that political machine, the poor fellow never stood a chance. He was tried on suspicion of heresy. His book was banned, and Galileo was found guilty and ordered to be imprisoned. It is suspected that the pope was the one responsible for having his sentence commuted to house arrest. He remained under house arrest (in his own villa) for the remainder of his life. This may seem harsh to us living in the 21st century, but keep in mind that with a heresy verdict on his head, Galileo's life was in danger. He could have been captured and killed by any number of princes and lords who viewed heresy tantamount to treason. Had he fled to Protestant territories, his fate would have been the same, since Protestants viewed heliocentricity as heresy too. House arrest was by far the most humane and charitable way of protecting a man with a price on his head. As long as he was under the guard of a Church deputy, his safety could be assured, and the Vatican could plausibly claim he was being punished for his "crime."
Contrary to popular urban legend, the Galileo inquisition was a political one, not a scientific one. Galileo was tried and condemned for what was perceived to be an attack on the pope, along with an attempt to preach scientific theory as theological truth. The Catholic Church never officially condemned Copernicus' theory of heliocentricity. It did condemn one of Galileo's statements that the sun is the center of the universe. On that point, the Catholic Church was actually right.
The Catholic Knight: The Galileo Inquisition Fully Explained