partly imperfect observation - the sun seems to go round it - and partly religiion: the Bible suggests that the earth is the centre of all creation. Actually, ancient Greeks and Indians had guessed this was wrong but it wasn't until the time of Copernicus that measuring was accurate enough to demonstrate it.
Consider also, that in a very real sense they were correct. The modern "Spaceship Earth" view and our current inability to go anywhere else means that from a day-to-day point of view the rest of the universe might as well not exist. (Personally I'd miss not seeing stars at night, but they don't add or subtract from my carbon footprint.)
It also suited the church to continue the belief that the Earth was the centre of the universe. If it was proved it was not then it reduced some of their power.
When Galileo was going to publish a book proving the Earth went round the sun the Roman Catholic church threatened to arrest him.
In the end he agreed not to publish the book, but they still kept him under house arrest.
The Pope apologised because of "faulty exegesis".Not the first time that the Church's explanation has been in language not understood by ordinary people!