It's possible that this whole procedure will make more sense if you see what it means in a concrete model of intuitionistic set theory. Let's work with the topos of sheaves on $\mathbb{R}$. I'll quote here some basic facts about this topos which you might take on faith, or you might treat as exercises depending on your background.
- In this world, the truth values are exactly the open subsets of $\mathbb{R}$.
- The natural numbers object $\underline{\mathbb{N}}$ is the sheaf sending the open subset $U \subseteq \mathbb{R}$ to $\underline{\mathbb{N}}(U) = \{ \text{locally constant functions } U \to \mathbb{N} \}$. You might think of elements of $\underline{\mathbb{N}}(U)$ as "natural numbers defined only on $U$"
- An "element" $n \in \underline{\mathbb{N}}$ is a locally constant function $\mathbb{R} \to \mathbb{N}$ (that is, a natural number defined everywhere). Note that, since $\mathbb{R}$ is connected, an everywhere defined locally constant function must be constant!
- A "subset" of $\underline{\mathbb{N}}$ is really a subsheaf of this sheaf. That is, if $X \subseteq \underline{\mathbb{N}}$ then we must have $X(U) \subseteq \underline{\mathbb{N}}(U)$ for all $U$, in a way that's compatible with the restriction maps.
- A statement $\varphi$ is true in the topos if and only if it's true on every open set $U$.
- A proposition (read: truth value, read: open set) $p$ is true on $U$ if and only if $U \subseteq p$. Notice that the only proposition which is true in the topos (by which again I mean "true on every $U$") is the whole set $\mathbb{R}$. Every other (nonempty) proposition is "true somewhere, but not everywhere", so that it's difficult to directly examine from "inside the topos".
Now it becomes clear how a subset $X \subseteq \underline{\mathbb{N}}$ which contains an element might fail to have a least element! If we fix a proper open subset $U \subsetneq \mathbb{R}$, then we can define a subsheaf $X \subseteq \underline{\mathbb{N}}$ by
$$
X(V) =
\begin{cases}
\{ 0, 1 \} & V \subseteq U \\
\{ 1 \} & V \not \subseteq U
\end{cases}
$$
(notice here we're using LEM in "the real world" (or the metatheory, if you like) to construct this sheaf. But that has nothing to do with LEM as interpreted in the topos, which is false.)
This subsheaf is inhabited since the statement $1 \in X$ is true (since $1 \in X(V)$ for each $V$). However, the statement "$1$ is the least element" cannot be true, since there are open subsets $V$ for which it's false! Thus we see that $\underline{\mathbb{N}}$ has inhabited subsets with no least elements!
Now, what about that proof of LEM? Well how do we interpret $X = \{ x : \underline{\mathbb{N}} \mid x = 0 \land p \}$?
Remember that our propositions (read: our truth values) are exactly our open subsets of $\mathbb{R}$. So $p$ "is" an open subset of $\mathbb{R}$. It's not hard to see that "$p$ is true on $U$" means that $U \subseteq p$ as open sets. From here, it's easy to compute an explicit description of the subsheaf $X \subseteq \underline{\mathbb{N}}$:
$$
X(V) =
\begin{cases}
\{ 0 \} & V \subseteq p \\
\emptyset & V \not \subseteq p
\end{cases}
$$
Of course, this looks very similar to the subsheaf we constructed in the previous part of this answer, and that's no accident!
As a nice exercise, you can play this game with any topological space (not just $\mathbb{R}$) and the bulleted "facts to take on faith" stay true. Can you show that, on a discrete space, every inhabited subsheaf of $\underline{\mathbb{N}}$ does have a least element? Can you (separately) show that LEM is true too? It's worth thinking deeply about the differences between that example and the one worked out in this answer.
I hope this helps ^_^