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$.