$\DeclareMathOperator\Spec{Spec}$Actually, your suggested categorical characterization of spectra of fields does work.
Edit: (I had written something incorrect here)
By Martin's comment below, we just have to show that maps from affines into $\Spec(k)$ are epis in the full category. But if we had two maps $f,g: \Spec(k) \rightarrow Y$ which agreed on some affine mapping into $\Spec(k)$, then first of all $f$ and $g$ would have to be the same topological map. Then both would land inside some affine $\Spec(R)\subset Y$, and now we're
reduced to the affine situation where we know it holds.
Conversely, suppose $X$ is not the spectrum of a field. If every point is dense, $X$ is affine
and we are done by what we know about the affine subcategory. Otherwise, we can find an open subscheme $U\subsetneq X$. Then the inclusion of $U$ into $X$ is not an epi as is witnessed by the two inclusions
$$X \rightrightarrows X\sqcup_U X,$$
where the last object is $X$ glued to itself along $U$.
For a category $\mathcal{C}$, let $\mathcal{C}'$ denote the full subcategory of $\mathcal{C}$ whose objects are the non-terminal objects of $\mathcal{C}$.
In a category, say that an object $Y$ is final if for every object $X$ there exists an epimorphism $X\to Y$.
In turn, say that an object of $\mathcal{C}$ is pre-final if it is a final object of $\mathcal{C}'$.
Then say that an object $Y$ of $\mathcal{C}$ is pseudo-Hausdorff if $\mathrm{Hom}(X,Y)$ is reduced to a singleton for every pre-final $X$.
Then in the category $\mathcal{C}$ of locally convex spaces (and also topological vector spaces over an arbitrary Hausdorff field), the terminal objects are those spaces reduced to $\{0\}$. In both $\mathcal{C}$ and $\mathcal{C}'$, epimorphisms are just surjective maps (this uses the existence of non-Hausdorff objects). In turn, the pre-final objects are those 1-dimensional non-Hausdorff spaces. And the pseudo-Hausdorff objects are then the Hausdorff spaces.
Best Answer
It is true and hods more generlaly for models of any algebraic theory with a Mal'tsev operation, i.e. a trinary operation $f$ such that $f(x,x,y)=y=f(y,z,z)$. For groups, you can take $f(x,y,z)=xy^{-1}z$. This is Theorem 10 in A.I. Mal'tsev, On the general theory of algebraic systems, Mat. Sb. (N.S.), 1954, Volume (35)(77), Number 1, 3-20.
A proof in English can be found on page 396 of V.V. Uspesnki$\check{\text i}$. The Ma'tsev operation on countably compact spaces. Comment. mat. Univ. Carolinae30 (1989) 395-402. available at https://dml.cz/bitstream/handle/10338.dmlcz/106758/CommentatMathUnivCarol_030-1989-2_22.pdf
The idea is to first simplify the situation of a regular epimorphism $X\to Y$ by using the fact it is the coequalizer of its kernel pair, hence the quotient of an equivalence relation on $X$, whence we want to show that the set of equivalence classes intersecting an open subset $U$ of $X$ is open, i.e. that any $y\in X$ equivalent to $x\in U$ has an open neighborhood of points $z$ equivalent to points in $U$.
But if this relation is kernel pair in the category of models of a theory, then whatever operations the theory has, the equivalence relation has to respect. In particular, $x\sim y$ implies $f(x,y,z)\sim f(x,y,z)\sim f(x,x,z)=z$. Then because $f$ is continuous, there is an open that contains $z$ if and only if $f(x,y,z)\in U$, in which case $z\sim f(x,y,z)\in U$ for any $z$ in that open. Moreover, $x=f(x,y,y)$ implies the open contains $y$ and so is the desired neighborhood.