I bet it was stressful and discouraging whenever Paul was thrown into prison - hard on Paul himself, and hard on the Christians of his day who depended on his wisdom. However, if Paul had never spent time in jail, we would have 5 less books in the Bible! Ephesians, Philippians, Colossians, Philemon, and 2 Timothy were all written during times of imprisonment! So, in a way, these "sad" imprisonments have been a blessing to countless Christians for many centuries now!
† † †