In his time of trouble King Ahaz became even more unfaithful to the LORD. He offered sacrifices to the gods of Damascus, who had defeated him; for he thought, “Since the gods of the kings of Aram have helped them, I will sacrifice to them so they will help me.” But they were his downfall and the downfall of all Israel. 2 Chronicles 28:22-23
King Ahaz gave in to what is common among those with little or no faith in God, or a wrong perception of God. God is not a genie at your command. Having no hope in God only leads to further destruction. In this case, not just for Ahaz, but for all Israel. Still, if there is a redeeming quality about Ahaz, it is that he fathered a son, Hezekiah, who would become a good and faithful King, leading the nation to God, rather than away from God as his father Ahaz had done.