In spite of a prevalent cultural attitude towards sin that excuses misbehavior if a person had "good intentions", most Christian traditions do not seem to include the persons feelings in the matter when defining an action as sin or not. However the converse does not seem to be as frequently addressed. Are there Christian traditions that have specific teachings about a "good" action being still sinful under some conditions? If so, what are do these teachings consider the basis of sin and how would a worldly good dead not meet those conditions?
Lets use an example:
Where I live street beggars are common place. Just as common place is the act of fishing in ones pocket for a coin or two to leave with them. Where in any Christian traditions teaching would this be dealt with as a potential sin trap? How would these teachings define sin in such a way that even an act of deliberate charity could be considered sinful?
Note: For the purpose of this question we can rule out what the beggar chooses to do with the money. This isn't about unintended consequences of that action down the road. Likewise I would eliminate "sins of omission" from the discussion in so far as this isn't about what else I could have done with the money or what more good I could have done and didn't.