Okay, I think I am on my way to an answer. This is nowhere near a full answer, but it is too large for a comment, and so I will post it here. Essentially, the key ingredient is to use Grothendieck topologies. I am not fully familiar with these yet (my interests in logic are primarily philosophical and as such my topos theory is rusty), but the open coverings they define seem to provide a nice generalization of the concept of open set that we could apply to Heyting categories. Corrections and criticisms in the comments are welcome.
I claim that the construction of $\mathrm{Spec}(\mathcal{H})$ for a Heyting category $\mathcal{H}$ can be formulated rigorously using the language of Grothendieck topologies. We begin by noting that $\mathcal{H}$ is a coherent category in which the subobject lattice $\mathrm{Sub}(X)$ of each object $X$ is a Heyting algebra. For each morphism $f: X \to Y$, there exists a pullback functor $f^*: \mathrm{Sub}(Y) \to \mathrm{Sub}(X)$, along with adjoint quantifier functors $\exists_f$ (left adjoint) and $\forall_f$ (right adjoint), which encode existential and universal quantification, respectively. This internal logical structure allows us to define a Grothendieck topology $J$ on $\mathcal{H}$, specifically the canonical (or coherent) topology generated by the logical deductions in $\mathcal{H}$.
The objects of $\mathcal{H}$ are interpreted as logical contexts, and the morphisms represent transitions between contexts. A sieve $S$ on an object $X$ in $\mathcal{H}$ is a collection of morphisms ${f: Y \to X}$ such that if $f \in S$ and $g: Z \to Y$, then $f \circ g \in S$; that is, the sieve is "downward closed" under composition. A sieve $S$ is said to be a covering sieve in the Grothendieck topology $J$ if there exists a finite family of monomorphisms ${m_i: A_i \hookrightarrow X}$ such that $S$ is generated by the $m_i$, and the union of the subobjects $A_i$ covers $X$, i.e., $\bigvee A_i = 1_X$ in $\mathrm{Sub}(X)$. It seems to me that this corresponds to the logical assertion that the $A_i$ collectively represent a deduction that covers the entire context $X$.
We now step towards (provisionally) defining the spectrum $\mathrm{Spec}(\mathcal{H})$ with the Grothendieck topos $\mathrm{Sh}(\mathcal{H}, J)$, which consists of all sheaves on the site $(\mathcal{H}, J)$. A presheaf $P: \mathcal{H}^{\mathrm{op}} \to \mathbf{Set}$ assigns to each object $X \in \mathcal{H}$ a set $P(X)$ and to each morphism $f: X \to Y$ a map $P(f): P(Y) \to P(X)$. The presheaf $P$ is a sheaf if it satisfies the sheaf condition with respect to the topology $J$. That is, for every covering sieve $S$ on $X$, and for any compatible family of local sections ${\sigma_f \in P(Y_f)}_{f \in S}$, there exists a unique global section $\sigma \in P(X)$ such that $P(f)(\sigma) = \sigma_f$ for all $f \in S$. This reflects the logical principle that local truths determined by covering families can be uniquely glued to a global truth.
The "open sets" of $\mathrm{Spec}(\mathcal{H})$ correspond to the sieves generated by subobjects in $\mathrm{Sub}(X)$. For a subobject $A \hookrightarrow X$, we define the sieve $S_A = \{f: Y \to X \mid f \text{ factors through } A\}$; that is, $f$ factors as $Y \xrightarrow{h} A \hookrightarrow X$. This sieve reflects the logical proposition represented by $A$ in the context $X$. The intersection and union of these sieves correspond to the logical conjunction and disjunction, respectively, of the subobjects in $\mathrm{Sub}(X)$, aligning the topological structure with the logical operations in $\mathcal{H}$.
Finally, we define $\mathrm{Spec}(\mathcal{H})$ from the space of sheaves $\mathrm{Sh}(\mathcal{H}, J)$, with the points of the space corresponding to geometric morphisms $\mathbf{Set} \to \mathrm{Sh}(\mathcal{H}, J)$. These points can be interpreted as models or valuations of the internal logic of $\mathcal{H}$, assigning truth values to propositions in a way that respects the logical structure. This parallels the classical spectrum $\mathrm{Spec}(H)$, which consists of homomorphisms from a Heyting algebra $H$ to $\{0, 1\}$, capturing all possible consistent evaluations of the propositions in $H$.
Feedback and criticism are welcome.