By Fubini's theorem, the sum of the reciprocals of the primes is equal to $\int_1^\infty \frac{\pi(x)}{x^2}\ dx$, where $\pi(x)$ is the number of primes less than x. The prime number theorem tells us that $\pi(x) \sim x/\log x$ for large x, which implies the divergence of this integral. (One does not need the full strength of the PNT here; the more elementary fact that $\pi(x)$ is bounded from below by a constant multiple of $x / \log x$ would suffice.) A variant of this argument shows that $\sum_{p \leq x} 1/p = \log \log x + O(1)$ (again, this can also be shown by more elementary means - see Mertens' theorem).

The same argument shows that slightly thinner sets than the primes would also have this property, e.g. any set for which the analogue of $\pi(x)$ is asymptotically larger than $x / \log x \log \log x$, or $x / \log x \log \log x \log \log \log x$, would still diverge. On the other hand, if the analogue of $\pi(x)$ is $O( x / \log^{1+\varepsilon} x )$ for some $\varepsilon > 0$ then one will have convergence. So the primes are close to the edge of the sparsest set with this property (as one could already guess from the double-logarithmic growth of the sum).

For instance, sieve theory tells us that the number of twin primes less than x is $O( x /\log^2 x)$, which implies Brun's theorem that the sum of reciprocals of twin primes converges.