The particle of mass $m$ in the box of length $L$ in 1D is solved by wavefunctions
$$
\begin{align}
\psi_{n\alpha}&=A\sin (k_n x) e^{-\omega_n t}|\alpha \rangle\;, \\
k_n&=\frac{n\pi}{L}\;,\\
E_n&=\hbar \omega_n\;,\\
\omega_n&=\frac{\pi h n^2}{4L^2m}\;.
\end{align}
$$
Here, $|\alpha \rangle$ represents the spin state.
The global fermionic wavefunction for two particles is constructed from all pairs by anti-symmetrization, as
$$
\Psi_{n\alpha m\beta}(x_1,x_2,t)=\psi_{n\alpha}(x_1,t)\psi_{m\beta}(x_2,t) - \psi_{m\beta}(x_1,t)\psi_{n\alpha}(x_2,t)\;.
$$
Energy of state $\Psi_{n\alpha m\beta}(x_1,x_2,t)$ can be calculated as
$$
(H_1+H_2)\Psi_{n\alpha m\beta}(x_1,x_2,t)=(E_n+E_m)\Psi_{n\alpha m\beta}(x_1,x_2,t)\;,
$$
since each of the one-particle Hamiltonians acts on the respective one-particle wavefunction $\psi_{n\alpha}(x_1,t)$, which yields its eigenenergy $E_n$.
For identical spins, we are interested only in solutions for which $\alpha=\uparrow$ and $\beta=\uparrow$. The ground state is the lowest lying energy state of the system. In this case, it would correspond to $\Psi_{1\uparrow 1\uparrow}$, but this function is identically zero. Then next two lowest lying states are $\Psi_{1\uparrow 2\uparrow}$ and $\Psi_{2\uparrow 1\uparrow}$. Thanks to the antisymmetrization, $\Psi_{1\uparrow 2\uparrow} = -\Psi_{2\uparrow 1\uparrow}$ and it represents the ground state of the system with energy $E_1+E_2$. For opposite spins, we choose $\alpha=\uparrow$ and $\beta=\downarrow$. Here, the lowest lying energy state is $\Psi_{1\uparrow 1\downarrow}$ and it has energy $2E_1$.