My recollection is that Galileo was tried not for being a heretic, but for publishing a book he'd earlier promised not to publish without church approval.
In any case, the church was far less the source of Galileo's problems than his fellow academic colleagues, who were envious and resentful of his encroachment on their areas of "expertise" -- namely, their theories dependent on the Ptolomaic system.
It was they, the university academics, who goaded the church into finally taking action; the church was initially reluctant to take issue with Galileo.
Time for some de-mythologizing. Did you know that several Cardinals funded Copernicus' studies?
Galileo was placed under house arrest for continuing to insist that the Catholic Church teach heliocentrism. Then, as now, the Church's responsibility is to teach regarding faith and morals, not natural science.
However, when natural science reaches beyond its science, such as when evolutionists teach materialistic philosophy, then the Church will teach against fallacious "scientific" (i.e. philosophic) claims. Today, the Church allows a variety of beliefs regarding human origins, but rules out strictly materialistic explanations.