Solutions abound which are exegetical-theological in nature.
I would like to approach the problem from a narrower perspective, that of syntax. The problem of the relationship of the four elements which make up v. 17 can be resolved by reading the interrelationships differently from the usual manner. Ordinarily, 17d is read as the conclusion of at least 17a and 17b, if not also of 17c. That is to say, 17b is to be considered a parenthetical comment 3 which affirms again the struggle by noting that the spirit struggles against the flesh. It is not a characteristic of the reciprocal struggle of flesh and spirit.