Attachment to sin is when we do not detest a sin. We avoid the sin because we know it to be wrong or because we want to avoid punishment for the sin but we still have an attraction or desire of the sin (Matt. 26:41).
In the secular world it is akin to wanting to do something but only avoiding it because it is against the law or has a severe penalty.
As disciples of Christ are called not to just avoid sin but also to truly love what is good and pleasing to God and to detest what is evil and sinful. This is not easy due to Original Sin but with grace it is possible.