There are so many different perspectives from which to look at this question, many of which yield different answers.
From the point of view of prisoners, this is a bad thing. It makes it so prisoners have a much harder time ever making it back into mainstream society.
From the long term point of view of our society, it is probably a bad thing. Having too many people in prison takes away from our ability to grow as a country. It takes a large number of people and removes them more or less permanently from the pool of high quality resources that could be used to make our economy improve.
From a financial point of view, it is less clear. Prisons do cost a tremendous amount to run. However, if we were to focus on rehabilitation within prisons, it might cost even more as we would have to pay for the programs. It might save us money in the long term, though, if it were to reduce recidivism rates.
From the short term point of view of our society, it is probably a good thing. People want criminals to be punished, not "coddled." In this view, when we punish criminals, we shore up the rest of society by making people feel that ours is a society in which justice is done and those who violate our laws are punished.
So, this question can be addressed from so many different points of view that it is exceedingly difficult to identify the one right answer.