וַיִּֽמְעֲל֔וּ בֵּאלֹהֵ֖י אֲבוֹתֵיהֶ֑ם וַיִּזְנ֗וּ אַחֲרֵי֙ אֱלֹהֵ֣י עַמֵּי־הָאָ֔רֶץ אֲשֶׁר־הִשְׁמִ֥יד אֱלֹהִ֖ים מִפְּנֵיהֶֽם׃
And they broke faith with the God of their fathers, and went astray after the gods of the peoples of the land, whom God destroyed before them.
Rashi
כי תמעל מעל — The term מעל everywhere in Scripture denotes “changing”. Similarly it stales, (I Chronicles 5:25) “And they committed a מעל against the God of their fathers; for they went a whoring after the gods of the people of the land” (i. e. they exchanged Him for their gods). And similarly it states of the faithless wife, (Numbers 5:12) “[If any man’s wife go aside] and commit a מעל in respect to him” (i. e. she changes her relationship to him for one to another man) (Sifra, Vayikra Dibbura d'Chovah, Section 11 1; Meilah 18a).