Ethics is often defined as a moral code that defines the difference between right and wrong. Ethics often features traits that are pro-establishment and that favor the wealthy. Examples of pro-establishment ethics are don't do illegal drugs and don't commit crimes. An example of pro-wealthy ethic is to not steal or cheat. Society doesn't determine what drugs or acts are unethical to do.
Ethics are primarily an attempt to provide a tax on doing things that ordinarily have no consequence like keeping lost property or seeing someone cheat. Ethics are an attempt to fix the marginal cost-marginal benefit curve to reach the optimal equilibrium point. Ethics can also be viewed as a way to counterattack the prisoner's dilemna problem.
The prisoner dilemna's problem is where both criminals end up cheating when the optimal outcome is when both criminals don't cheat. Ethics is an attempt to make sure that both criminals don't cheat but placing a sort of guilt tax on any criminal that does cheat.
Ethics has nothing to do with right or wrong. There are tons of valid reasons to cheat, steal, lie, and perform illegal activities. There is also the view that there is in fact no right or wrong at all and that there just is. Is it right or wrong for society to impose rules on the things that you passionately believe in? Is it right or wrong for that society to not provide you any other location to perform the things you want to do?
Ethics is a good system that helps to achieve an equilibrium outcome. It's like an unwritten contract that states "I won't kill you" if "You don't kill me". Some people might call that karma but others would point out that indepent probability theory states that someone else's chance of doing something (in general) has little to do with what you've done before. Karma is an attempt to provide a marginal benefit of "Doing the right thing".
Ethics has the bad attribute of discouraging people from challenging the establishment and status quo. Ethics are an important part of the social contract even though some have manipulated and twisted their true purpose.