The above words are spoken by a banker in the story. One evening at a party, while discussing the pros and cons of the death penalty and life imprisonment, a young lawyer exclaims that, if he were a criminal, he would choose life imprisonment over death. Hearing this, a banker makes a challenge to the young lawyer. He bets the young lawyer two million dollars that he could never stay in solitary confinement for five years. The young lawyer responds by saying that he'll do better than five years: he'll stay for fifteen years.
Meanwhile, the banker is tremendously pleased; he's willing to bet what he considers a trifling sum of two million against the lawyer. Later, however, he tries to warn the young lawyer against making a big mistake. While the sum of two million is insignificant to him, he fears that the young lawyer will be giving up some of the best years of his life. Additionally, the banker doesn't think that the lawyer will be able to tolerate more than three or four years in close confinement. Thus, he advises him to consider his ill-advised bargain, stating that "voluntary confinement is a great deal harder to bear than compulsory."
Now, we come to the quote you are interested in. The banker tells the lawyer: "The thought that you have the right to step out in liberty at any moment will poison your whole existence in prison." The banker means that the lawyer will never have the discipline or courage to see the bet through: the idea that he can leave at any time will make his voluntary confinement so difficult to bear that he will come to hate his life in prison.
Also, it will be cold comfort to know that the only thing keeping him in his prison is his pride and professional reputation: when loneliness and the feeling of extreme deprivation dawns on him, the young lawyer will beg to be released. This hypothesis is based, of course, on the banker's presuppositions about the young lawyer.