You're confused about this notation, most likely because of what I suspect is the inconsistent use of summation convention.
The first statement is only correct if implicitly summed over $j$:
$$\sum_j \delta_{ij}\delta_{jk} = \delta_{ik}$$
The last statement however is only true if there is no summation over $i$, since generically if $i=1,2,\ldots,n$ then
$$\sum_i \delta_{ii} = n$$
This inconsistency is what is causing you problems.
(Notice for example that if $n=1$ then there is no such ambiguity but indeed it is not possible for $\delta_{ij}$ to be anything other than 1!)
Edit in response to comment: To respond to your comment, no. $\delta_{ij}$ takes different values depending on what $i,j$ are. For example in 3D,
$$\delta_{ij} = \pmatrix{1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1}_{ij}$$
Hence using summation convention, e.g. $\delta_{ii} \equiv \delta_{11} + \delta_{22} + \delta_{33} = 3$
Generally, $\delta_{ij}$ is just a thing that tells you whether or not $i = j$. If yes, then it is 1, if no, then it is 0. You can also think of these as the components of the identity matrix as suggested in the comments by Bye_World.
Let's write sums, just for now: $$\begin{align} \sum_{i,j} A_{ij}\big( \delta_{ik}\delta_{jm} -\frac{1}{3}\delta_{ij}\delta_{km} \big) &= \sum_{i,j}A_{ij}\delta_{ik}\delta_{jm} - \frac{1}{3}\sum_{i,j}A_{ij}\delta_{ij}\delta_{km} \\ &= \sum_{i,j}A_{ij}\delta_{ik}\delta_{jm} - \frac{1}{3}\delta_{km}\sum_{i,j}A_{ij}\delta_{ij} \\ &= A_{km} - \frac{1}{3}\delta_{km}(A_{11}+A_{22}+A_{33}),\end{align}$$so the answer is not only $A_{km}$.
Best Answer
Levi Civita symbol $\epsilon_{ikl}$ is defined as it follows $$\epsilon_{ikl} = \left\{ \begin{array}{cl} 1 & if\quad i\neq k\neq l\quad and \quad even \quad permutation\\ -1& if\quad i\neq k\neq l\quad and \quad odd\quad permutation\\ 0 & otherwise \end{array}\right.$$
From this definition, let's start with the contraction of $\epsilon_{ijk}$ in its first index: $$\epsilon_{ikl}\epsilon_{imn}=\delta_{km}\delta_{ln}-\delta_{kn}\delta_{lm}\tag1$$
Where $\delta_{ik}$ is the Kronecker delta (identity matrix), a symmetric isotropic tensor and it is defined as it follows $$\delta_{ik} = \left\{ \begin{array}{cl} 1 & if\quad i= k\\ 0 & otherwise \end{array}\right.$$
Contracting $(1)$ once more, $\textit{i.e.}$ multiplying it by $\delta_{km}$ we have $$\delta_{km}\epsilon_{ikl}\epsilon_{imn}=\epsilon_{ikl}\epsilon_{ikn}=\delta_{km}(\delta_{km}\delta_{ln}-\delta_{kn}\delta_{lm})=\delta_{kk}\delta_{ln}-\delta_{kn}\delta_{kl}=\delta_{kk}\delta_{ln}-\delta_{ln}\tag2$$ Recall that $\delta_{lk} = \delta_{kl}$ due to symmetry properties and $\delta_{km}\delta_{km}=\delta_{kk}=\delta_{mm}$ since they are dummy indices (repeated indices indicated summation over this index).
Now comes the term $\delta_{ii}$, this quantity is a scalar, and represents the trace of the identity matrix in a n-dimensional space, therefore $\delta_{ii}=n$ and finally $(2)$ is written as it follows $$\epsilon_{ikl}\epsilon_{ikn}=(\delta_{kk}-1)\delta_{ln}=(n-1)\delta_{ln}$$ If one contracts again, the following identity $$\epsilon_{ikl}\epsilon_{ikl}=n(n-1)$$
In your case $n=3$.
Hope this helps you