They are both grammatically correct, and both means the same thing. Maybe someone else has something to add about exactly when one would use one versus the other? Personally, I think they are equivalent and I would use either one. However, in the second case I would be more likely to say "Eating a lot of eggs is unhealthy" beause it just sounds slightly more natural.