Wright suggests that in Romans 6, “righteousness” (dikaiosune) is a virtual proxy for God himself. In extensive use in chapter 3, “the righteousness of God” (dikaiosone theou) refers to God’s covenant faithfulness, and much of Romans 3–8 has an underlying narrative substructure of exodus—a transition from slavery to freedom. But then, 6:18 speaks of “slaves of righteousness.” Here’s Wright:
When, in 6.18, Paul writes that ‘having been liberated from sin, you have become slaves to righteousness,’ ‘righteousness’ stands once more for the covenant God himself, whose demands of absolute covenant loyalty from his people include but far transcend what we mean by ‘ethics’. The proof of this point comes in verse 22, where, after speaking for the previous several verses of ‘righteousness’ as the new master of the freed slaves, Paul finally abandons the trope and declares that now, ‘having been set free from sin, you were enslaved to God’.
I think that really is a clincher. In that light, it would be fruitful to think about Paul’s reference to the “obedience of faith” that he makes at the outset of the letter (1:5). The righteousness of God entails God’s own faithfulness of bringing liberty to captives; faith brings about obedience to God rather than to the enslaving powers.