As you read through the history of the kings of Israel and Judah in scripture, the first thing said about most of them is whether or not they served God. The next thing you read is what they did about the high places in the land (2 Kings 18:4, 23:8; 2 Chronicles 14:3, 31:1). These high places were where the Canaanites worshipped their pagan gods before Israel took possession of the land God promised to Abraham. To keep these places of worship intact represented rebellion and a lack of faith in Yahweh.
Often the people would erect Asherah poles atop the high places to worship Asherah, the supposed god of fertility and nature. Both the high places and Asherah poles were detestable to God, so the best kings tore them down. Lesser kings let them stand and they became stumbling blocks for the nation. There is more than a history lesson in all this, but also a stark warning for each of our lives.