Why are 2 ways to calculate the energy of the ground state?
Both formulas have exactly the same meaning. They are just two different ways of not double counting the Coulomb and the exchange interactions. In principle, the goal can be achieved in two ways:


double counting in the first place and then dividing by two (first formula);
counting wisely so that there is no double counting in the first place (second formula).


Obviously, for any practical purposes when you one does not want to double count one would almost always choose the second procedure, but the first representation in some cases provides more apparent picture when dealing with the formulas analytically.



Where does all this come from?

The whole derivation of the expression for the ground state Hartree-Fock energy basically starts from writing down the expectation value of the ground state electronic energy for the ground state Slater determinant $\Phi_{0}$
$$
\langle \Phi_{0} \mid \hat{H}_{\mathrm{e}} \mid \Phi_{0} \rangle \, ,
$$
in terms of the individual spin-orbitals of which $\Phi_{0}$ is constructed.
And in doing so we use the so-called Slater rules and it happens so that the electronic Hamiltonian $\hat{H}_{\mathrm{e}}$ contains only two different kinds of operators:


one-electron operators of the form 
$$
    \hat{F} = \sum\limits_{i=1}^{N}\ \hat{f}(i)\,,
$$
and two-electron operators of the form
$$
    \hat{G} = \frac 12 \sum\limits_{i=1}^{N} \sum\limits_{j=1\atop{j\neq i}}^{N}\ \hat{g}(i,j)\,.
$$


Already at this stage an expression for any two-electron operator $\hat{G}$ could as well be written as
$$
    \hat{G} = \sum\limits_{i=1}^{N} \sum\limits_{j&gt;i}^{N}\ \hat{g}(i,j)\,.
$$
The mathematical meaning is exactly the same: we do not want to double count pairwise interactions, so that if, say $\hat{g}(1,2)$ is already counted, $\hat{g}(2,1)$ has to be excluded. 

Note carefully that we also have to exclude physically meaningless self-interactions, such as, say, $\hat{g}(1,1)$, which is done in the first case by an additional restriction on summation $j\neq i$ and in the second case by the strict inequality in the lower limit of summation $j&gt;i$.

With respect to the exclusion of this non-physical self-interactions note now that they it is missing from the HF energy expression being written in the first form. But that is perfectly fine since each and every Coulomb self-interaction is perfectly canceled by the corresponding exchange self-interaction. Thus, you do not necessarily need the above mentioned additional restriction of the form $j\neq i$ ($b \neq a$ this time), although you could include it if you would like to,
$$E_0= \sum_{a=1}^{N} \langle a|h|a\rangle + \frac{1}{2} \sum_{a=1}^{N} \sum_{b=1\atop{b \neq a}}^N \langle ab||ab\rangle \, ,$$
or adopting a rather usual convention for such summations, as follows,
$$E_0= \sum_{a=1}^{N} \langle a|h|a\rangle + \frac{1}{2} \sum_{a=1}^{N} \sum_{b \neq a}^N \langle ab||ab\rangle \, .$$