"The Church" wasn't then and isn't now a monolith of opinion.
A modern characterisation of "The Galileo Affair" would be that he was SWAT'ed by someone he was really really mean online to.
Thus the whole "Galileo affair" starts as a conflict initiated by a secular Aristotelian philosopher, who, unable to silence Galileo by philosophical arguments, uses religion to achieve his aim. [1]
and
While delle Colombe was almost alone in arguing publicly against Galileo, there was a group of scholars and churchmen who supported his Aristotelian views. After Galileo referred disparagingly to delle Colombe as 'pippione' ('pigeon'), his close friend the painter Lodovico Cigoli coined the nickname 'Lega del Pippione' ('The Pigeon League') for delle Colombe's group.[2]
Galileo literally refered to delle Colombe (and friends) as
Simplicio (simple minded) and worse in his highly popular
Dialogue Concerning the Two Chief World Systems [3] and within a year or so the Pigeon League got their revenge, using their influence to have religuous charges bought against Galileo.
The affair was complex since very early on Pope Urban VIII had been a patron to Galileo and had given him permission to publish on the Copernican theory .. this was very much a case of personal vendettas and internal politics rather than a straight up case of "The Church Versus Galileo".
[1] https://en.wikipedia.org/wiki/Galileo_affair#cite_note-Spell...
[2] https://en.wikipedia.org/wiki/Lodovico_delle_Colombe
[3] https://en.wikipedia.org/wiki/Dialogue_Concerning_the_Two_Ch...