Be amazed at this, O heavens, and shudder with sheer horror, says the LORD.
Two evils have my people done:
They have forsaken me, the source of living waters.
They have dug themselves cisterns, broken cisterns, that hold no water.
It's interesting that Israel's idolatry is expressed as two evils, that forsaking God is an evil distinct from embracing Baal. This is consistent with the Jewish tradition that, "I am the LORD your God," and, "You shall have no other gods before me," are two distinct commandments.
It also suggests a person might commit one evil without committing the other. That's not how I usually think of things, but then I usually think of idolatry in very general terms, that any good whatsoever (including the virtue of religion) sought ahead of God can be considered an idol.
In Jeremiah's day, though, idolatry meant idolatry. And certainly you can forsake God without literally worshipping an idol.
We might interpret the image of water in this passage as signifying the graces and blessings God provides to those who live [I made the common mistake of first typing "love"] according to His statutes. To forsake the Source of living waters is to declare that you don't need His graces and blessings.
Why might someone think they don't need God's graces and blessings? Let us list the ways:
They don't need any graces and blessings.
God has no graces and blessings to give.
God will give them graces and blessings even after they've forsaken Him.
They can manufacture their own graces and blessings.
They can get the graces and blessings somewhere else.
Note that only the last two imply the second evil of idolatry. If you don't think you need water, you aren't going to build a cistern.