First note that $\mathcal C^K$ is again an $\infty$-category. Then this follows from the fact that passing from an $\infty$-category to the largest Kan complex contained in it is a functor right adjoint to the inclusion of Kan complexes into all $\infty$-categories. This is proved in Prop 1.2.5.3 of HTT. That is, adjointness tells us more generally that if $S$ is a Kan complex and $X$ is an $\infty$-category, then any map $S \to X$ factors through the largest Kan complex contained in $X$. (The ordinary categorical counterpart of this statement is that if $S$ is a groupoid and $X$ is a category, then any functor $S \to X$ factors through the maximal subgroupoid of $X$, i.e. the groupoid of isomorphisms in $X$. In the same way, the 1.2.5.3 says that the largest Kan complex contained in an $\infty$-category $X$ is given by throwing out all 1-cells which are not equivalences.)