The proof I know of uses the theory of compact operators. From Evan's PDE book (see section 6.5 and appendix D.6):
Let $H$ be a separable Hilbert space, and suppose $S: H \to H$ is a compact and symmetric operator. Then there exists a countable orthonormal basis of $H$ consisting of eigenvectors of $S$.
Then the Fredholm alternative tells us, possibly apart from $0$, that the spectrum of $S$ consists entirely of eigenvalues, and that the corresponding eigenspaces are all finite dimensional. (we used the compactness of $S$ here) Further, if the operator is elliptic, then $0$ is not in the spectrum, and we are in even better shape.
Next, the symmetry allows us to deduce that the eigenspaces are orthogonal.
The next step is harder to briefly summarize, but we look at the collection of all the eigenspaces $\tilde H$ and show that it is dense in $H$ (by showing that $\tilde H^\perp = \emptyset$, which relies on something like the Raleigh quotient for symmetric operators).
Finally, we have our orthogonal eigenspaces for all the non-zero elements of the spectrum, and for the "eigenspace" corresponding to $0$ (i.e. the null-space of $S$), we appeal to the separability of $H$ to get a basis for that space, and we are done. (Though really, most of the time, you have an elliptic operator, so you can avoid this last part entirely).
Now, if you start without boundary conditions, this is equivalent to choosing a different Hilbert space $H$ (e.g. going from $H = \{f \in L^2(\Omega) : f|_{\partial \Omega} = 0\}$ to $H = L^2(\Omega)$). Remember that the question of whether an operator is bounded (let alone compact) depends not only on the operator, but on the domain as well. So, if we switch from one Hilbert space to the next, we might end up with an unbounded operator; in fact this is easy to demonstrate for examples like $H = L^2([0,1])$, $S = i\frac{d}{dx}$.
So, while there might be a (obvious) way to relate this to Stone-Weierstrass, I see this primarily as a failure of the Fredholm alternative; i.e. changing the boundary condition can lead to an unbounded (hence non-compact) operator, and so Fredholm fails.