Isaiah is prophesying during the reign of several kings. He is partially a contemporary with Amos. Isaiah is prophesying to the southern kingdom of Judah.
Yahweh is ticked at Judah. They have run amok without regard for His teaching. This is a common thread in the Old Testament and in prophecy specifically.
Yahweh continues with his woes upon Judah. There is comparison drawn to Sodom and Gomorrah. He detests their offerings and good deeds because they are done for the sake of doing, rather than out of obedience. An analogy is made to the justice system. There is slight hope in vv. 19-20 - a promise of redemption if obedience is put on.
Inclusio vv. 21-26: "faithful city." Yahweh continues to illustrate the detestableness of Judah. Analogy to dross - impurities that come to the surface when smelting silver. More hope appears in this section, but it ends with a promise of doom and despair for rebels and sinners.