Zephaniah is referring to flat roofs. We know the kings of Judah had erected altars on them (2 Kings 23:12), but rooftop shrines were not just a matter of royal activity. Jeremiah talks about “all the houses where they burned incense on the roofs to all the starry hosts and poured out drink offerings to other gods” (Jeremiah 19:13; Jeremiah 32:29). Pagan influences had penetrated the family piety of the land (Jeremiah 7:18; Jeremiah 44:19).
5 those who bow down on the roofs to the host of the heavens, those who bow down and swear to the LORD and yet swear by Milcom,