Immanuel Kant is the designer of the Categorical imperative. Considered one of the greatest philosophers, me included, Kant went out to discover an ethical system that had no loopholes to be abused. This led to the the categorical imperative, but first, some background...

The categorical imperative was designed to be something that anyone could use and would be something that everyone essentially knew on there own. This lead the imperative to be based on the Law of Thoughts. This consists of 3 laws that are all a priori: 1)Law of Identity - A is A, 2) Law of Excluded Middle - either A or not A, 3) Law of Non-Contradiction - A and not A is false. These are a priori laws that can not be denied. Kant used these to develop the categorical imperative.

He also based it on a person's good will. Kant said that reason is just too messed up to be what nature intended us to use it as a way to figure out what is right and wrong. What it is for, though, is the development of a good will. According to Kant a good will is a rational being that consistently lives by rational principles which can be graspped and one that can recognize beauty, which leads to dignity. A good will is the only thing in the universe that is good in itself; everything else derives its good from something else. A good will derives its own goodness. So most things derive their goodness from a good will.

Knowing this, Kant came up with the categorical imperative. This has 3 versions. First is that you perform that act which you wish to become a universal law; this is known as universalizibilty. The second is to treat everyone as a person as an end in themself and not a means only. That means treat every person as a person and not a thing. The last one is to live as a citizen of a kingdom of ends, or in other terms as a person in a kingdom of people.

To better understand all of this, lets use an example. Let's say that you have been called to testify in court. Some one might tell the truth because they are afraid that the will be found in contempt of court. Someone following the categorical imperative would tell the truth out of duty to other people, not for fear of retribution. Essentially you never do anything for benfit or fear of something; you do it because it is your duty to others that you do it.

Another key point about the categorical imperative is the idea of a rational beings and people. A person is a rational being who does rational thing. Someone who systematically treats people not as people but as things is no longer considered a person but a thing himself. Murder is a good example. A rational being would never kill another rational being, but a thing would. Kant says that mistakes happen, so if you kill someone by accident, you are still a rational being. but if you systematically kill someone, such as the Nazis, then you become a thing and can be treated as one, which includes lying to and even killing since once someone becomes just a thing you can treat him as such. This is key since if a person is not a thing but a rational being you can not hurt them, lie to them, etc. You even have to do all that is within your power to save a rational being.