It is [...] an elementary misunderstanding to think that Kantian ethics is committed to a system of inflexible moral rules just because it regards moral imperatives as categorical imperatives. [...] It is also an elementary misunderstanding of the concept of a categorical imperative to think that because Kantian ethics grounds obligation on such imperatives, it has no concern for ends or (therefore) for the consequences of actions.
Kantian Ethics (2008) - Ch. 4. The Moral Law