It specifically is illegal actually.
You forget this pesky "t" variable in the equation that represents TIME.
It is illegal *NOW*. It wasn't illegal when she was in office. The requirement to use government hosted email was passed after Clinton resigned and only became legally effective in November of 2014. Clinton left office in February of 2013.