That is because the adjoint $A^*:D(A^*) \to H$ of an operator $A: D(A) \to H$ exists if $D(A)$ is dense in $H$. Next, since $A=A^*$ if $A$ is selfadjoint, we have that $D(A)=D(A^*)$ is dense.
The requirement $D(A)$ dense for defining $A^*$ has the following reason.
By definition we have both
$$D(A^*) := \{x \in H \:|\: \langle x| Ay \rangle = \langle z_x| y\rangle, \quad \forall y\in D(A)\}\:,$$
and
$$A^*x := z_x \quad \forall x \in D(A^*)\:.$$
One has to check if $A^*x$ is well defined,i.e.,
there a unique $z_x$ such that $ \langle x| Ay \rangle = \langle z_x| y\rangle$ for all $y\in D(A)$.
This is the case if $D(A)$ is dense.
Indeed, suppose that $ \langle x| Ay \rangle = \langle z'_x| y\rangle$ for all $y\in D(A)$ is also valid. As a consequence of linearity of the scalar product,
$$\langle z'_x-z_x| y\rangle=\langle x-x|Ay\rangle =0 \quad \forall y \in D(A)\:.$$
Since $D(A)$ is dense, we can find a sequence $D(A) \ni y_n \to z'_x-z_x$ giving rise to
$$||z'_x-z_x ||^2=\langle z'_x-z_x| z'_x-z_x\rangle=0\:,$$ because the scalar product is continuous,
which implies $z'_x=z_x$. Linearity of $D(A^*) \ni \mapsto z_x$ easily arises from the given definitions, antilinearity of the scalar product in the left entry in particular.
By construction $A^*$ is closed (it immediately arises fron its definition). This fact also implies that selfadjoint operators are closed as well.
Warning: $A$ is not necessarily closed on the whole Hilbert space, but just on its dense domain. Closedness on the whole Hilbert space would imply that the operator is bounded due to the Closed Graph Theorem. This is not the case in general in quantum theory.