This is a big misconception. The 6th commandment actually says "Thou shall not murder". "Murder" is very different than "kill". The definition of "murder" is "premeditated killing with criminal intent and malice".
Here is a good article about this...
Scripture delineates a distinction between killing and murdering. “You shall not kill” is actually not a command found in the Ten Commandments. The command from scripture in the original language actually says “You shall not murder” (Exodus 20:13). The Hebrew word for “murder” literally means “the intentional, premeditated killing of another person with malice.”
Interestingly, most of us are familiar with this definition of murder, because it is reflected in the Penal Codes of our country. In my home state of California, the Penal Code provides this definition of murder:
187. (a) Murder is the unlawful killing of a human being, or a fetus, with malice aforethought.
Malice is a form of evil intent that separates “murder” from “killing”. Even today there are acceptable forms of killing that lack this kind of evil intent, and these forms of killing exist as exceptions in the murder laws of the United States.
In California, for example, a homicide is justified (according to Penal Code sections 187, 196 and 197) if one of the following conditions is met:
A person kills someone accidentally
A person is trying to defend him or herself and prevent his or her own murder (self-defense)
A person is trying to prevent someone from entering his or her house to commit some violent felony
A person is trying to prevent the murder of someone else (protecting an innocent)
In all these situations, killing is actually legal and justifiable, and exceptions of this nature exist in the Penal Codes of every state in America. Even those who don’t accept the existence of God or the authority of the Bible recognize the necessity for laws like these; laws that allow for deadly force to be used to accomplish some greater good.
http://coldcasechristianity.com/2013/the-difference-between-killing-and-murdering/#.dpuf