This is a case of using a sort of natural units (similar to geometerized units), which are often convenient in relativity (special and general). Take, for instance, the Minkowski metric of special relativity. In dimensional units, it is
$$\mathrm{d}s^2=-c^2\mathrm{d}t^2+\mathrm{d}x^2+\mathrm{d}y^2+\mathrm{d}z^2$$
Setting $c=1$ makes it a bit more convenient, and gives time and space the same units - which is more intuitive, if you think of time as another dimension.
You also brought up $E=mc^2$. This is a special case of the energy-momentum relation:
$$E^2=p^2c^2+m_0^2c^4$$
Setting $c=1$, we have the much more convenient form
$$E=p^2+m_0^2$$
This comes up again and again. Add to this the mass-energy equivalence that is also important in relativity (especially the right-hand side of the Einstein field equations), and it simply makes sense to treat energy and mass as the same thing. In fact, it becomes perhaps even more useful than in special relativity, because we also often set $G=1$ - and that comes up a lot in general relativity.
Now, the units of density under this system are $\text{Length}^{-2}$, and the density above is clearly not in those units. I'm guessing that this just isn't a case of setting $G=1$ - and that makes sense, because in cosmology and astronomy, many types of densities are measured in g/cm3: dark matter, interstellar gas and dust, and sometimes dark energy. Keeping it in $\text{Mass}\cdot\text{Length}^{-3}$ makes it easy to compare these, working in a system that is more commonly used.
In a nutshell, then: Cosmologists sometimes like $c=1$ (and sometimes $G=1$) because it makes a lot of equations a lot easier to write out. Here, it becomes really easy to compare mass densities and energy densities.