That's not an office politics issue.
You disagree with the ethical judgements of the leadership of your current company. In the long term either you decide your ethics are less important than the paycheck or you decide the paycheck is less important than your ethics and find a different job (either voluntarily or involuntarily). You will likely not be able to force the ethical judgements of the people leading your current company to change to match your own.
Now if you weren't able to predict the consequences of cc'ing a company lawyer in an e-mail to your boss's boss, then yes, you may also have some limitations with modeling the thought processes of other humans and that's a good skill to try to develop. A good rule of thumb is that going over someone's head is never going to make that person happy with you. In this case, your bosses boss said "redundant6939, please do X" and instead of telling him fair and square "I don't think this is ethical" or "I'm not comfortable doing this unless we get our lawyer to sign off on it" you waiting (from his perspective) "told on him" to company lawyer so she could turn tell him that he made a bad/illegal call in front of everyone else on the e-mail thread, so now he feels like he lost face in front of his peers and subordinates AND that his authority was circumvented. (Edit: and as gerardc points out, there can be things where the company wouldn't culpable if it acted in ignorance, but once you have an electronic paper trail asking "hey is what we're doing illegal? should we check with the lawyers?" it now becomes a much bigger problem, so there is a culture of having any discussions about legal issues in person or over the phone.)
Now he's a bad guy proposing unethical things, and you were right and he was wrong. But until and unless you're ready to leave the job he's got some degree of power over you, so its important to be able to have a mental model of how he's likely to react to your actions. With office politics, as with all politics, it's good to keep in mind what Machiavelli said about doing your enemies small injuries.*
*Don't do your enemies small injuries because they'll extract a larger revenge on you in return. Either let things slide, or go after them with enough force that they won't have any opportunity to get back at you later (I'm paraphrasing).