1 Peter 2:12, 15, ESV
Why not sin?
(1) For the glory of God among the unsaved. If others accuse us of being sinful in the ways that they are, looking for weakness and hypocrisy, and don't find it, that gives credence to God and his resurrection power in our lives. When God holds them accountable for those accusations, they will give God the glory for our deeds.
(2) For the sake of conscience and not being hypocrites. The essence of the situation in this verse is that we may be accused of sin but we will be proven innocent. If we sin in ways that even the world would understand is wrong for a Christian, when accusations are made we won't be able to confidently plead innocence without being hypocrites and lying. If they suggest you do sinful actions when you go home or are alone, a clear conscience will support a heart-felt denial and cheerful demeanor. Defending yourself isn't necessary. Good deeds will do more to dispel accusations than words will.