The causes of action in the lawsuit were unlawful termination on account of political activities (which are protected in California) and sex (which is protected federally). Google made three motions to dismiss and lost all of them. Does that mean Google is guilty? Of course not. All it means is that the claim stated by Damore, if true, could convince a reasonable jury that Google violated his civil rights.
Google would much rather pay out settlement money than risk having an unflattering jury verdict or have to release even more unflattering documents in discovery. I'm sure Damore would rather not go to trial if he could help it as well.