"they were unfaithful to Yahweh"
This phrase tells why they should have worshiped God.
"they chose to be loyal to other gods"