This is an excellent question, and I'd suggest the full details as to the answer of this question are more complicated and nuanced than many might assume.
The first factor to keep in mind is that the Heliocentric Universe took a long time to be perfected. The original system as devised by Copernicus was not actually a correct model of the solar system, and it would be only through the work of later scientific thinkers (such as Kepler and Newton) that his ideas would be strengthened and refined.
In addition, it should be noted that the Church did not invent geocentricism for its own theological purposes—rather, geocentrism was accepted knowledge going back to the Classical era, defended by key philosophers and thinkers such as Aristotle and Ptolemy. They came to these ideas in good faith, within the limitations of their time, and if we recognize that their model of the universe was inaccurate, we should also recognize that much of their reasoning could be entirely valid given the information available to them and the intellectual context in which their ideas took shape. These ideas had already become established as conventional knowledge about cosmology, long before the Church entered into the picture.
Furthermore, it's also worth noting that this notion had theological implications. Over time, these ideas were incorporated into the theological teachings of the Church, and thus, to attack this idea was to attack those teachings, placing official doctrine into question.