The answer by Matt F links to a sequence in the OEIS database, but provides no direct/clear motivation.
One can motivate the answer by considering a random walk with an absorbing boundary. You can consider starting from position 1 for the difference of boys/girls and move up and down randomly with 50% probability until reaching zero.
These type of walks have been described here: What is the distribution of time's to ruin in the gambler's ruin problem (random walk)? and based on the results in those answers we can see that the survival function is related to the binomial distribution.
Imagine, without loss of generality (the situations are symmetric), that the first kid was a boy. The odd rows from Pascal's triangle give the possible number of ways to reach a difference of boys-girls after $t$ kids.
$$\begin{array}{cccccccc|l}
&&\llap{\text{difference}}\rlap{\text{ of boys - girls}}&&&&&&{\text{number of kids}}\\
-3&-2&-1&0&1&2&3&4 \\ \hline
\color{red}{}&\color{red}{}&\color{red}{} &1 & \color{blue}{1}& \color{blue}{}& \color{blue}{}&\color{blue}{}&2\\
\color{red}{}&\color{red}{}&\color{red}{1} &3 & \color{blue}{3}& \color{blue}{1}& \color{blue}{}&\color{blue}{}&4\\
\color{red}{}&\color{red}{1}&\color{red}{5} &10 & \color{blue}{10}& \color{blue}{5}& \color{blue}{1}&\color{blue}{}&6\\
\color{red}{1}&\color{red}{7}&\color{red}{21} &35 & \color{blue}{35}& \color{blue}{21}& \color{blue}{7}&\color{blue}{1}&8\\
\end{array}$$
- The black column represents the number of ways that we can reach at a zero difference of boys - girls.
- There is also a possibility that we reached zero difference before, that is equal to the blue numbers minus the red numbers. Motivation: for each possibility to have reached a negative difference, there is an equivalent possibility to reach a positive difference while having hit zero difference before (consider mirroring the steps after reaching the zero the first time).
Therefore, the probability to still have not reached a zero difference, is equal to the probability to have reached a zero difference.
So for even positive values of $t$ we have:
$$\begin{array}{}P(T>t) &=& P(\text{difference} = 0 | T=t)\\
& = &{{t-1 }\choose {t/2-1} }0.5^{t-1}
\end{array}$$
And the expectation value can be computed as
$$\begin{array}{}
E[T] &=& \sum_{t=0}^\infty P(T>t) \\
&=& 2 \sum_{t=0}^\infty P(T>2t) \\ &=& 2 + \sum_{t=1}^\infty \underbrace{ {{2t-1 }\choose {t-1} }0.5^{2t-2}}_{= 2 \cdot \prod_{s=1}^t \frac{2s-1}{2s}}
\end{array}$$
which diverges.
(the second equality occurs because the probabilities are the same for odd and even numbers, when equal boys and girls have not been reached for $2k$ children then neither will it have been reached for $2k+1$ children)
Comparison with simulations:

set.seed(1)
### function to simulate the random walk
sim = function() {
difference = 1
steps = 1
while(difference != 0) {
steps = steps + 1
if (steps == 1000) {
difference = 0 ## this will stop the loop
} else {
difference = difference + 1 - 2*rbinom(1,1,0.5)
}
}
return(steps)
}
### compute several walks
t = replicate(10^5, sim())
### compute the survival function
k = c(1:50)*2
s = sapply(k, FUN = function(ki) {mean(t>ki)})
### plot simulations with computation
plot(k,s,
xlab = "number of children t",
ylab = "P(T > t)",
main = "survival function of waiting time T \n for event of equal number in boys and girls")
lines(k,dbinom(k/2-1,k-1,0.5))
Could you perhaps give an intuitive explanation as to why the answer is infinite
Consider the absolute difference between boys and girls $X$ and the expected number of steps $T(k \to l)$ to go from $X=k$ to $X=l$.
After one child we always have $X = 1$, so let's consider $T(1 \to 0)$. From $X=1$ we get with $1/2$ probability back to $X=0$ and with $1/2$ probability to $X=2$. The waiting time can be expressed as one plus the weighted sum of the respective branches after that one step
$$T(1 \to 0) = 1 + \frac{1}{2} \cdot 1 + \frac{1}{2} \cdot T(2 \to 0)$$
and since we can split up the expected waiting time $T(2 \to 0) = T(2 \to 1) + T(1 \to 0)$, and expected waiting time to go from two to one is the same as waiting time to go from one to zero $T(2 \to 1) = T(1 \to 0)$ we get to
$$T(1 \to 0) = 1 + T(1 \to 0)$$
which would lead to a contradiction for any finite waiting time.