I don't know if prisoners ever really did subsist on only bread and water. In most prison movies, the grub more closely resembles school cafeteria food. Then again, maybe it does happen sometimes. As the Israelites suffered under God's judgment, they felt as if they had been sentenced to prison. Maybe that's a good analogy.
Sin can be a prison.
The problem with sin is that it makes us its slave. And as we suffer the consequences of our sin, the diet is never satisfying. Many non-Christians have the misconception that God cuts in on our freedom. I even know some Christians who have fallen into this trap. They have bought the lie and have ended up prisoners of their own desires.