Qwest CEO Joseph Nacchio did that when it was blatantly illegal - he's serving a six year prison sentence now.
He was imprisoned for insider trading, appealed on the basis that a witness's testimony (relating to the data-grab) was excluded from his defence, and won a re-trial where he had his conviction and sentence re-instated.
My understanding of this sequence of events is that while the witness was improperly excluded from his trial (thereby allowing him a re-trial), it did not materially alter anything about the 19 counts of insider trading of which he was convicted. So basically he did a good thing, then did a bad thing, and went to prison for the bad thing. Seems all right.
“Show me the man and I’ll find you the crime.”
- Lavrentiy Beria, head of Joseph Stalin's secret police