Kant's example of a perfect duty to others concerns a promise you might consider making but have no intention of keeping in order to get needed money. Naturally, being rational requires not contradicting oneself, but there is no self-contradiction in the maxim “I will make lying promises when it achieves something I want”. An immoral action clearly does not involve a self-contradiction in this sense (as would the maxim of finding a married bachelor). Kant's position is that it is irrational to perform an action if that action's maxim contradicts itself once made into a universal law of nature. The maxim of lying whenever it gets what you want generates a contradiction once you try to combine it with the universalized version that all rational agents must, by a law of nature, lie when it gets what they want.