"Everyone who sins is a slave to sin" John 8:34
The righteousness and the sin are fundamentally voluntary, however the sin can be comparatively or metaphorically speaking a form of slavery, and this is so in the most scandalous and serious sins.
In the Letter to James we have an explanation of sin: "If anyone, then, knows the good they ought to do and doesn't do it, it is sin for them", James 4:17. From a philosophical point of view, sin is a form of error, of not hitting the target.
The reason that has as own finally the deliberation, from the analysis of Thomas Aquinas, tells to man what is his own true good (the blessed life), but when man practice the sin, he goes against the reason because his goal are the false goods. The search for the false goods directs the behavior and the man loses his unity as a person, as a soul, and as a result, in the cases of the most serious sins, the mint fights against itself: the sin (error, failure) it is painful in itself.
The Sin has another aggravating factor: it distorts the reason, reason is obscured. The one who sins what he does is to miss, and one error generates another. When sin becomes a habit, a frequent practice, the mind loses the ability to find the best solutions, the mind chosen by appetite and passion, there is a loss in the ability to evaluate problems, the mind is conditioned, limited . And it is here where "almost forced" acts are observed, like those of the slave, as in the case of addictions (alcohol, for example). Good is joyful and evil is devastating.
It is by these factors that metaphorically is spoken of slavery. The sinner chooses his favorite sin and his master (the false good) as a result his conduct leads him to the works of the flesh: "fornication, impurity and debauchery, idolatry and superstition, hatred and discords, jealousy, fits of rage, selfish ambition, envy, drunkenness and orgies", Galatians 5:19
To download for free in pdf format the book of philosophy: https://yadi.sk/i/PQDVLwWN_jYdSg