First of all, note that the discrete-time Fourier transform (DTFT) of a sequence is always periodic with period $2\pi$:
$$X(\omega)=\sum_{n=-\infty}^{\infty}x[n]e^{-jn\omega}\tag{1}$$
This is obvious because $e^{-jn\omega}$ is $2\pi$-periodic in $\omega$.
Next, consider the inverse DTFT:
$$x[n]=\frac{1}{2\pi}\int_{-\pi}^{\pi}X(\omega)e^{jn\omega}d\omega\tag{2}$$
For $X(\omega)=\delta(\omega-\omega_0)$, we get from $(2)$
$$x[n]=\frac{1}{2\pi}\int_{-\pi}^{\pi}\delta(\omega-\omega_0)e^{jn\omega}d\omega=e^{jn\omega_0}\tag{3}$$
[Note that without loss of generality we assume that $-\pi\le\omega_0\le\pi$ because $X(\omega)$ is $2\pi$-periodic. $X(\omega)=\delta(\omega-\omega_0)$ is a shorthand for $X(\omega)=\sum_k\delta(\omega-\omega_0-2k\pi)$. That shorthand can be used here because we know that $X(\omega)$ is the DTFT of some sequence, and hence $2\pi$-periodicity is understood].
Since $\textrm{IDFT}\{\delta(\omega-\omega_0)\}=e^{jn\omega_0}$ we're inclined to accept
$$\textrm{DTFT}\{e^{jn\omega_0}\}=\sum_{n=-\infty}^{\infty}e^{jn\omega_0}e^{-jn\omega}=\delta(\omega-\omega_0)\tag{4}$$
(where $2\pi$-periodic continuation is understood), even though
the sum
$$\sum_{n=-\infty}^{\infty}e^{jn\omega_0}e^{-jn\omega}\tag{5}$$
doesn't converge in the conventional sense. However, this can be made mathematically sound by interpreting the sum $(5)$ as a distribution.