In what ways does the denial of bail as a punishment challenge the principles of justice in India?

This question invites reflection on the ethical and legal implications of using bail denial as a punitive measure, and how it aligns or conflicts with the fundamental rights guaranteed by the Indian Constitution.