Here's a definition of the diagonal functor from my lecture notes:
Let us introduce the diagonal functor $\Delta: C \rightarrow \operatorname{Fun}(I, C)$ given by sending $x \in C$ to the constant functor $i \mapsto x$ (and morphisms sent to identities).
So define the constant functor $F_x: I \rightarrow C$ that maps every $i \in \operatorname{Ob}\ I$ to $x \in \operatorname{Ob}\ C$ and every morphism $i \rightarrow j \in I$ to $id_x: x \rightarrow x$.
Then consider morphisms $f: x \rightarrow y$ in $C$ and $\phi: i \rightarrow j$ in $I$. According to the above definition, $\Delta$ maps $x \mapsto F_x,\ y \mapsto F_y$ and it maps $f: x\rightarrow y$ to some $\Delta_f: F_x(i) \rightarrow F_y(j)$. So I guess when the definition above says "morphisms sent to identities" what they mean is that $\Delta_f(i) = f$ for all $i \in I$.
Then the square with upper row $x = F_x(i) \xrightarrow{F_x(\phi)=id_x} F_x(j) = x$, and lower row $y = F_y(i) \xrightarrow{F_y(\phi)=id_y} F_y(j) = y$, and vertical maps $\Delta_f(i) = f$ and $\Delta_f(j) = f$ commutes trivially, ie. this does seem to be a well-defined functor (modulo a few additional checks, on compositions etc).
Is the above interpretation correct? If so, what motivates this? The square I just constructed is not too illuminating...
Your interpretation is correct.
It seems like a trivial functor, but it's actually very useful—for example, a category $\mathcal{C}$ has all limits (resp. colimits) of shape $\mathcal{I}$ if and only if the diagonal functor $\Delta : \mathcal{C} \to \mathrm{Fun}(\mathcal{I}, \mathcal{C})$ has a right (resp. left) adjoint: $$\mathrm{colim} \dashv \Delta \dashv \mathrm{lim}$$
A specific instance of this is when $\mathcal{I} = \mathbf{0}$ is the empty category. Then $\mathrm{Fun}(\mathcal{I}, \mathcal{C}) \cong \mathbf{1}$, the terminal category, and then the corresponding diagonal functor is just the unique functor $\mathcal{C} \to \mathbf{1}$. This functor has a right (resp. left) adjoint if and only if $\mathcal{C}$ has a terminal (resp. initial) object.
Another instance is when $\mathcal{I} = 2$ is the discrete category with two objects. Then $\mathrm{Fun}(\mathcal{I}, \mathcal{C}) \cong \mathcal{C}^2$, and the diagonal functor $\mathcal{C} \to \mathcal{C}^2$ has a right (resp. left) adjoint if and only if $\mathcal{C}$ has binary products (resp. coproducts).