King Zedekiah is still disobedient to God; but gives a show of pretense. He gets a little bit of relief from war with Babylon, but this makes him hope that perhaps they will go away. So he asks Jeremiah to speak to the Lord and hear what He says. Sounds good! He hopes that the Lord won’t punish them. This only shows how far away from God he was. The princes accuse Jeremiah of siding with the enemy, because he had said that punishment was coming. So they put him in prison.
Zedekiah, probably because he had a bad conscience, lets Jeremiah out from prison. But he was too weak to confess his sins, and obey the Lord.