This example you may profoundly understand:
"When we were in a Soviet prison as political dissidents, we recited Shakespeare to each other to keep our souls alive. It was very wicked and very dangerous, but it kept up our spirits and cleansed our hearts of hatred and despair."
It was wicked because a rule was broken, but wickedness could be so good, if the rule was stupid or even unjust.