Deuteronomy 12:3
And ye shall overthrow their altars, and break their pillars, and burn their groves with fire; and ye shall hew down the graven images of their gods, and destroy the names of them out of that place. And ye shall overthrow their altars, and break their pillars, and burn their groves with fire; and ye shall hew down the graven images of their gods, and destroy the names of them out of that place.
The command required complete removal of pagan worship by overthrowing altars, breaking pillars, burning sacred groves with fire, hewing down graven images of false gods, and destroying their names out of the place. Nothing of that system was to be left standing, with even the memorial names to be erased. The groves were places of idol worship where trees and other things God had created were used to honor gods fashioned by human hands instead of thanking and worshiping the Creator.
The order to destroy idolatrous places and objects was given as protection against the influence of the surrounding nations. Their attractive groves, shrines, temples, and altars could deceive the people and displace God in their minds.