The branch of philosophy that deals with good, bad, right, and wrong is called ethics.
Ethics has to do with what's moral and what is not - what you can do as a member of a society, and what is morally (although not legally) forbidden. Ethical laws are not the same as societal laws - sometimes something can be acceptable when it comes to ethics, but not actual governmental laws.