A lattice $L$ is distributive iff for every $a\ne b$ in $L$ there is a prime ideal $P\in\textrm{Spec}(L)$ s.t. either $a\in P\not\ni b$ or $b\in P\not\ni a.$
Right to left. Since $D:L\to2^{\textrm{Spec}(L)},D(a)=(P\in\textrm{Spec}(L)|a\notin P),$ is injective, $L$ is isomorphic to a sublattice of a boolean lattice $2^{\textrm{Spec}(L)},$ and hence, distributive.
Left to right. "It's a classical theorem by M. Stone". I've tried to find a proof at
Stone M. H. The theory of representations for Boolean algebras
but didn't spot the theorem there. Could you please give me a (more precise) reference or maybe write a proof itself? Thanks in advance!
(Notice that in right to left, you also need to prove that $D$ is a homomorphism, that is, $D(a\wedge b)=D(a)\wedge D(b)$ and $D(a\vee b)=D(a)\vee D(b)$.)
For the other direction, this follows from the Distributive Prime Ideal principle.
Here, from Introduction to lattices and order, by Davey and Priestley, 2nd ed., page 235:
Then, in the following page,
Sure you can use (DPI) to get the desired implication:
if $a \nleq b$, take $J={\downarrow}b$ and $G={\uparrow}a$.