Why can't we make a universal rule like "I will lie to save someone's life from a murderer"? What contradiction would result from this rule? And if we can't make that a universal rule, then why can we make "I will kill in self-defense" a universal rule?
With the first formulation of the Categorical Imperative, one conceives of a world where every rational agent abides by the maxim in question, and see if it produces either a contradictory set of affairs (thus informing us on perfect duties) or a universally undesirable set of affairs (informing us regarding imperfect duties). Never lying concerns the former, while sometimes giving to charity is one of Kant's examples of the latter. (Groundwork of the Metaphysics of Morals — 1785)
Lying is never permissible because, in any condition one provides for the exception to the behavior, no rational agent would even bother to pose a question in such a situation. Consider the following maxim: I shall not repay a debt if it saves the lives of my family, and presume it as a universal law of human behavior. Now, would you hand out a loan (on the expectation of being repaid) to someone you knew was borrowing the money to save their family? No, you know they won't pay you back. Same with the murderer: the murderer wouldn't even bother to ask us, thus it's a contradictory state of affairs. Thus, we have a perfect duty to never be dishonest.
Regarding self-defense, consider the following maxim: I shall be willing to kill an agent if my life is under threat by that same agent, and assume it a universal rule of human behavior. The same dynamic with dishonesty simply does not arise here. If everyone turned violent for self-defense, it does not prevent the practice of self-defense from arising (not contradictory), nor does it produce a universal undesirable state of affairs (that is, we don't have a world none of us would want to live in, as say with the case where nobody gave to charity and we were down on our luck and thus destitute). Sure, murderers may not be so willing to be violent towards rational beings anymore, but said rational beings do not initiate said violence, and so there is no internal inconsistency on the part of the defender.
In the Groundwork of the Metaphysics of Morals (1785), Kant explicitly defends the universal prohibition against lying (that is, the perfect duty to never lie) twice: first in reference to the First formulation of the Categorical Imperative (universalizability formula) and the Second Formulation of the Categorical Imperative (humanity formula). This is alongside other moral duties he argues for, one being the imperfect duty to give to charity.
Kant's reasoning is consistent with how he established how the Categorical Imperative works back in the 1780s. To avoid these results, one has to critique his original analysis regarding the Categorical Imperative. My personal disagreement with Kant of course then, is a disagreement with his overall project on ethics.