For when you were slaves of sin, you were free in regard to righteousness. But what fruit were you getting at that time from the things of which you are now ashamed? For the end of those things is death. -Romans 6:20–21 (ESV)
Using the principle of contraries (slave vs. free, sin vs. righteousness), Paul argues from the true perspective that a slave can only have one master. When the Christians at Rome were slaves to sin, they could not also be subjects of righteousness. This doesn’t mean they never did any good—even a stopped watch is right twice per day—but they lived in the realm of sinfulness without much thought or desire for righteousness.
And now reflecting on their former lifestyle, Paul uses an agricultural metaphor (reaping and sowing) to show how it was that they were indeed slaves to sin because they were reaping that which is, in their new spiritual frame of reference, shameful. And the end (telos) of those things they were reaping is death.
A slave can only have one master so being a slave to sin puts a man on a specific trajectory that is free of righteousness; it’s a trajectory that yields shame and ends in death—even eternal death. Only by being purchased (ransomed or redeemed) by a new master that is righteous can one be free from sin and its fruit of shame and death.