What is the meaning of this analogy between lattices and topological spaces? Let me add one more edit to help explain why this is a serious question. Theorem 5 below is a sort of lattice version of Urysohn's lemma, and it has essentially the same proof. Theorem 6, the famous theorem of Raney characterizing completely distributive lattices, is an easy consequence of this result. In other words, a result of basic importance in lattice theory is somehow at heart "the same" as Urysohn's lemma. But "the same" in what sense?

I noticed this weird analogy a long time ago. Is there a good explanation?
A lattice is a partially ordered set in which every pair of elements has a least upper bound and a greatest lower bound. Now let me set up some very nonstandard terminology which will show what I am talking about. Say that a lattice is compact if every subset has a least upper bound (join) and a greatest lower bound (meet). A map between lattices is continuous if it preserves arbitrary (i.e., possibly infinite) joins and meets whenever these exist in the domain. A subset $C$ of a lattice is closed if $$x \in C,\,x \leq y \quad\Rightarrow\quad y \in C$$ and $C$ is stable under the formation of arbitrary meets whenever these exist. A subset $U$ is open if $x \in U,\,x \leq y \,\Rightarrow \,y \in U$ and the complement of $U$ is stable under the formation of arbitrary joins whenever these exist. A subset is clopen if it is both closed and open. A lattice is totally disconnected if for every $x \not\leq y$ there is a clopen subset containing $x$ but not $y$. A lattice is Hausdorff if for every $x \not\leq y$ there exist a closed set $C$ and an open set $U$ whose union is the whole space and such that $x \in U$, $y \not\in C$.
Note that "closed" and "open" do not refer to any topology. For instance, the union of two closed sets need not be closed. I am aware that every poset carries a natural topology, but that does not seem particularly relevant here.
Now here are some theorems.
Theorem 1. Any union of open sets is open, and any intersection of closed sets is closed.
Theorem 2. A map between two spaces is continuous if and only if the inverse image of any closed subset is closed and the inverse image of any open set is open.
Theorem 3. Any continuous image of a compact space is compact.
Theorem 4. A space is totally disconnected if and only if it embeds in a power of the two-element space.
Theorem 5. If a space is compact Hausdorff and $x \not\leq y$ then there is a continuous map into $[0,1]$ taking $x$ to $1$ and $y$ to $0$.
Theorem 6. Every compact Hausdorff space embeds in a power of $[0,1]$.
Theorem 7. Every compact Hausdorff space is the continuous image of a totally disconnected compact Hausdorff space.
(In the usual terminology, a "compact Hausdorff" lattice is a completely distributive complete lattice.)
Each of these statements is true both of topological spaces (replacing $x \not\leq y$ with $x \neq y$ in Theorem 5) and, with my terminology, also of lattices. I am not sure what form a satisfying explanation would take. Is there a broader theory of which topological spaces and lattices are both special cases? Is there some other way of understanding this? Or is it not as remarkable as it seems, and needs no special explanation.
(I'm including a category theory tag because I suspect that may be an arena in which an explanation could be found.)
Edit: I'm getting some feedback (Wallman's generalization of Stone duality, Scott continuity) describing other, as far as I can tell unrelated, connections between lattice theory and topology. Obviously that's not what I'm asking for.
Maybe I should emphasize that Theorem 6 is a serious result about completely distributive lattices, discovered in 1952 by G. N. Raney. From my point of view it is rather easy ... if anyone can show me how to get it out of Wallman's theory, I will retract the preceding comment.
 A: EDIT: I mentioned in the comments that Nik's list of definitions and theorems looks to me strikingly similar to Wallman's generalization of Stone duality.
After getting some feedback from Nik and taking some time to think about the problem more, the connection seems less direct than I previously suggested. However, I do still feel that there is a strong connection between Wallman's theory and Nik's, and I have edited my post to explain this as best I can.
This post does not completely answer Nik's question, but I hope it provides a useful partial answer.
Wallman's Construction:
The main difference between Wallman's theory and yours is that you seem to be thinking of lattice elements as points, whereas Wallman thought of them as closed sets.
I can't find a clear and thorough account of Wallman's results online except for his original paper (which is a bit lengthy, and uses some outdated terminology)

H. Wallman, ``Lattices and topological spaces," Annals of Mathematics vol. 39 (1938), pp. 112 - 126, available here.

I'll outline the construction here.
To every "compact, Hausdorff" lattice $L$ we may associate a topological space called $W(L)$. The points of $W(L)$ are not the members of $L$, but rather the ultrafilters on $L$. The idea is to put a topology on $W(L)$ in such a way that $L$ becomes (isomorphic to) the lattice of closed subsets of $W(L)$.
To put a topology on $W(L)$, let each $a \in L$ define a closed set
$$C_a = \{p \in W(L) : a \in p\}.$$
In other words, $C_a$ is the set of all ultrafilters containing $a$. With your definition of a compact lattice, it's not hard to check that these sets constitute the closed subsets of a topology on $W(L)$.
(Sidebar: If you don't require that every subset of $L$ has a greatest lower bound, then this construction will still work. Instead of giving you a topology, the sets $C_a$ will then define a basis for the closed sets of a topology. To see this idea at work, I recommend the first part of section 1 of this paper of Dow and Hart.)
Given a closed set $C$ in $W(L)$, we obtain a "closed" subset of $L$ (in your terminology) by considering $\{a \in L : C \subseteq C_a\}$. Given a "closed" subset $C$ of $L$, we obtain a closed subset of $W(L)$ corresponding to it, namely $\bigcap_{a \in C}C_a$.
As Nik points out in the comments, the converse is not necessarily true: in general, the lattice of closed subsets of a compact Hausdorff space is not necessarily a "compact Hausdorff" lattice.
Why I think Wallman's idea is relevant here:
Using Wallman's construction and known facts from point-set topology, we can derive "near-miss" versions of some of Nik's theorems. For example, we can get a weaker version of Theorem 5, where we drop the continuity requirement but still require our map to be order-preserving:
Theorem: Suppose $L$ is a "compact Hausdorff" lattice and $a \not\leq b$ are in $L$. Then there is an order-preserving map from $L$ into $[0,1]$ taking $a$ to $1$ and $b$ to $0$.
Proof: Let $X = W(L)$ be the compact Hausdorff space whose lattice of closed sets is isomorphic to $L$. In $X$, $a$ and $b$ correspond to the nonempty closed sets $C_a$ and $C_b$, and the relation $a \not\leq b$ translates to $C_a \not\subseteq C_b$. Let $x$ be a point of $X$ that is in $C_a$ but not in $C_b$. Since $X$ is $T_{3\frac{1}{2}}$, there is a continuous function $f: X \rightarrow [0,1]$ such that $f(x) = 1$ and $f(C_b) = 0$. Let $\varphi: L \rightarrow [0,1]$ be defined by
$$\varphi(d) = \sup \{f(z) : z \in C_d\}.$$
Clearly $\varphi(a) = 1$ and $\varphi(b) = 0$, and $\varphi$ is order-preserving. However, it is easy to come up with examples where $\varphi$ is does not preserve arbitrary meets and joins (hence the "near-miss").
Similarly, we can get a near-miss version of Theorem 6:
Theorem: If $L$ is a "compact Hausdorff" lattice, then there is an order-preserving injection from $L$ into a power of $[0,1]$.
Proof: Let $I = \{(a,b) \in L \times L : a \not\leq b\}$. For each $(a,b) = i \in I$, fix an order-preserving function $\varphi_i$ as in the previous theorem. Define $\varphi: L \rightarrow [0,1]^I$ by $\pi_i \circ \varphi(a) = \varphi_i(a)$. This function is clearly order-preserving. For injectivity, consider that for all $a \neq b \in L$, either $a \not\leq b$ or $b \not\leq a$.
We get a near-miss version of Theorem 4 in the same way (first prove a $0$-dimensional analogue of Theorem 5, stating that the function in question can be assumed to be two-valued).
