As @A.Γ noted, this is a special case of a more general fact about normal matrices, but we can prove it without that fact.
Let $\Lambda$ be a diagonal matrix with entries $\lambda_i$. We take $\lVert{A}\rVert_2 = \sup_{x\neq 0} \lVert{Ax}\rVert_2 / \lVert{x}\rVert_2 = \sup_{\lVert x \rVert_2 = 1} \lVert{Ax}\rVert_2$.
Taking $x$ to be the eigenvector corresponding to the largest magntiude eigenvalue gives,
$$
\lVert{Ax}\rVert_2 = \lVert{(\max|\lambda_i|)x\rVert}_2 = (\max|\lambda_i|) \lVert{x}\rVert_2 = \max|\lambda_i|
$$
So, for any matrix, the matrix 2-norm is always at least the size of the largest magnitude eigenvalue.
Now, let $x=[x_1,x_2,\ldots, x_n]^T$. Then $Ax = [\lambda_1 x_1, \lambda_2x_2, \ldots, \lambda_nx_n]^T$. Therefore,
$$
\lVert{Ax}\rVert_2 = \sum_{i=1}^{n} \lambda_i^2x_i^2
$$
Since $\lVert x \rVert_2 = 1$ we have that $\sum_{i=1}^{n} x_i^2 = 1$ , which implies that $ 0\leq x_i^2 \leq 1$. Therefore,
$$
\lVert{Ax}\rVert_2^2 = \sum_{i=1}^{n} \lambda_i^2 x_i^2
\leq \sum_{i=1}^{n} (\max|\lambda_i|)^2 x_i^2
= (\max|\lambda_i|)^2 \sum_{i=1}^{n} x_i^2
= (\max|\lambda_i|)^2
$$
Therefore, for diagonal matrices, the matrix 2-norm is bounded above by the size of the largest magnitude eigenvalue, and so the two quantities must be equal.