Parity considerations give a very clean solution, using surprisingly simple machinery: no Markov chains, no iterated expectations, and only high school level summations. The basic idea is that if the spider has moved an even number of times in the $x$ direction, it has returned to its original $x$ coordinate so can't be at the ant's position. If it has moved an odd number of times in the $x$ direction, then its $x$ coordinate matches the ant's. Only if it has moved an odd number of times in all three directions will it match the $x$, $y$ and $z$ coordinates of the ant.
Initially the spider has made zero moves in any of the three directions, so the parity for each direction is even. All three parities need to be flipped to reach the ant.
After the spider's first move (let's label that direction $x$), exactly one direction has odd parity and the other two ($y$ and $z$) are even. To catch the ant, only those two parities need to be reversed. Since that can't be achieved in an odd number of subsequent moves, from now on we consider pairs of moves. There are nine possible combinations for the first paired move:
$$(x,x), \,(x,y), \,(x,z), \,(y,x), \,(y,y), \,(y,z), \,(z,x), \,(z,y), \text{or} \,(z,z)$$
We need to move in the $y$ and $z$ directions to reach the ant after one paired move, and two out of nine combinations will achieve this: $(y,z)$ and $(z,y)$ would ensure all three parities are odd.
The other seven combinations leave one odd and two even parities. The three repeated moves, $(x,x)$, $(y,y)$ or $(z,z)$, leave all parities unchanged so we still require one $y$ and one $z$ movement to reach the ant. The other pairs contain two distinct moves, including one in the $x$ direction. This switches the parity of $x$ and one of the other parities (either $y$ or $z$) so we are still left with one odd and two even parities. For instance the pair $(x,z)$ leaves us needing one more $x$ and one more $y$ to reach the ant: an equivalent situation (after relabelling of axes) to where we were before. We can then analyse the next paired move in the same way.
In general paired moves start with one odd and two even parities, and will either end with three odd parities (with probability $\frac{2}{9}$) and the immediate capture of the ant, or with one odd and two even parities (with probability $\frac{7}{9}$) which returns us to the same situation.
Let $M$ be the number of paired moves required to reach the ant. Clearly $M$ follows the geometric distribution on the support $\{1, 2, 3, \dots\}$ with probability of success $p = \frac{2}{9}$ so has mean $\mathbb{E}(M) = p^{-1} = \frac{9}{2} = 4.5$. Let $N$ be the total number of moves required, including the initial move and the $M$ subsequent paired moves. Then $N = 2M + 1$ so, applying linearity of expectations, $\mathbb{E}(N) = 2\mathbb{E}(M) + 1 = 2 \times 4.5 + 1 = 10$.
Alternatively you might note $P(M \geq m) = (\frac{7}{9})^{m-1}$ and apply the well-known formula for the mean of a discrete distribution taking only non-negative integer values, $\mathbb{E}(M)=\sum_{m=1}^\infty P(M\geq m)$. This gives $\mathbb{E}(M)=\sum_{m=1}^\infty (\frac{7}{9})^{m-1}$ which is a geometric series with first term $a=1$ and common ratio $r=\frac{7}{9}$ so has sum $\frac{a}{1-r} = \frac{1}{1-7/9}=\frac{1}{2/9}=\frac{9}{2}$. We can then take $\mathbb{E}(N)$ as before.
Comparison to Markov chain solutions
How might I have spotted this from the Markov chain transition matrix? Using @DLDahly's notation, the states in the transition matrix correspond to my description of the number of the number of directions with odd parity.
The one-step transition matrix is
\begin{equation}
\mathbf{P} = \left[\begin{array}{cccc}
P_{S \to S} & P_{S \to A}& P_{S \to B} & P_{S \to E} \\
P_{A \to S} & P_{A \to A}& P_{A \to B} & P_{A \to E} \\
P_{B \to S} & P_{B \to A}& P_{B \to B} & P_{B \to E} \\
P_{E \to S} & P_{E \to A} & P_{E \to B}& P_{E \to E} \\
\end{array}\right] = \left[\begin{array}{cccc}
0 & 1 & 0 & 0 \\
1/3 & 0 & 2/3 & 0 \\
0 & 2/3 & 0 & 1/3 \\
0 & 0 & 0 & 1 \\
\end{array}\right]
\end{equation}
The first row show us that after one movement, the spider is guaranteed to be in state A (one odd and two even parities). The two-step transition matrix is:
\begin{equation}
\mathbf{P}^{(2)} = \mathbf{P}^{2} = \left[\begin{array}{cccc}
1/3 & 0 & 2/3 & 0 \\
0 & 7/9 & 0 & 2/9 \\
2/9 & 0 & 4/9 & 1/3 \\
0 & 0 & 0 & 1 \\
\end{array}\right]
\end{equation}
The second row shows us that once the spider has entered state A, in two moves time it has either returned to state A with probability $7/9$ or has reached state E (all odd parities) and captured the ant, with probabilty $2/9$. So having reached state A, we see from the two-step transition matrix that the number of two-step moves required can be analysed using the geometric distribution as above. This isn't how I found my solution, but it is sometimes worth calculating the first few powers of the transition matrix to see if a useful pattern like this can be exploited. I have occasionally found this to give simpler solutions than having to invert a matrix or perform an eigendecomposition by hand - admittedly something that is only really relevant in an exam or interview situation.
self-study
tag and follow the guidelines at its tag wiki. Please edit this question and include it on future similar questions $\endgroup$