Galileo and the Church had the same fundamental belief: the Universe was designed by an all-powerful God and that God picked laws of physics that were mathematically elegant and beautiful.
The Church was not nearly as closed-minded about heliocentric theories in Galileo's time as is commonly thought. Their position was that if empirical evidence clearly showed that the universe did not work the way the Church thought that the Bible said it worked then the Church must have misinterpreted the Bible.
The problem with Galileo's heliocentric theory was that it was empirically not correct. If some observation didn't fit in with his theory and changing the theory to accommodate it would make the theory ugly or inelegant Galileo would dismiss that observation as observational error. God, he believed, would not make an inelegant universe.
What got him in trouble with the Church wasn't that he proposed a heliocentric theory. It was a combination of 5 things.
1. His theory wasn't better than the best current geocentric theories at actually predicting things.
2. He had a very big ego.
3. He was an asshole. If he saw you are a rival or as an inferior he was intolerant and rude to you. Because of his big ego, "inferior" included pretty much everybody.
4. He was a celebrity. The rich and powerful would regularly invite him to attend their gatherings.
5. He had a terrible sense of politics. #4 regular brought him in contact with people who could make his life miserable if he annoyed them too much, and #2 and #3 ensured the he did so.