One of the first major challenges to Kant's reasoning came from the Swiss philosopher Benjamin Constant, who asserted that since truth telling must be universal, according to Kant's theories, one must (if asked) tell a known murderer the location of his prey. This challenge occurred while Kant was still alive, and his response was the essay On a Supposed Right to Tell Lies from Benevolent Motives (sometimes translated On a Supposed Right to Lie because of Philanthropic Concerns). In this reply, Kant agreed with Constant, and argued that it is indeed one's moral duty to be truthful to a murderer.
Kant argued that telling the truth to the murderer is required because moral actions do not derive their worth from the expected consequences. He claimed that because lying to the murderer would treat him as a mere means to another end, the lie denies the rationality of another person, and therefore denies the possibility of there being free rational action at all. This lie results in a contradiction in conceivability and ergo the lie is in conflict with duty.
Furthermore, Kant questioned our ability to know that the expected future outcomes of our actions would actually occur. For example, suppose Jim said that the victim was in the park, when he thought the target was in the library. However, unbeknownst to Jim, the victim actually left the library and went to the park. The lie would actually lead the murderer to the victim, which would make Jim responsible for the murder[...]
Kant is restating that there cannot be any exceptions to the categorical imperative, for if you state that "You can never lie, unless it is to help another" then you must accept this as a universal rule, and one would not desire for everyone to lie to help others. Kant also states that lying to the murderer is making an exemption for yourself (avoiding universality) and using the murderer as a means to save your friend.