In "Biblical Perspective" Gordon Snider writes concerning Romans 7:4:

In verses 1-3 Paul had shown how death changes the relationship of the surviving marriage partner to the deceased. In this analogy the sinner is married to the law. But death (i.e., being crucified with Christ) breaks that bond. We would have expected that if man is married to the law, the law would have had to die in order for man to be free to marry another. It is not the law that dies, but the believer dies to the law. So long as we live for the law, we cannot live for Christ. That ye should be married to another. The person who is satisfied merely to be delivered from guilt does not truly understand the work of the cross. We are delivered from the law to be united with Christ, that we should bring forth fruit. In 6:22 Paul spoke of “fruit unto holiness,” and that thought seems to be carried on here, as the next two verses suggest.

Source: Studies in Romans: Adult Teacher's Insights, page 34.