Agarose gels (hydrogels) are commonly used in molecular biology for electrophoresis of DNA.
This phenomenon is NOT observed in acrylamide gels used for electrophoresis of protein. Unpolymerized and polymerized acrylamide both appear clear.
I assume that what we are observing here is light scattering. I am not sure if the scattering is Rayleigh or Mie, and I am not sure why it occurs upon agarose gel formation. I am not sure why it doesn't happen with acrylamide, another gel.