Google has to compete with all the other companies for the same pool of talent. They can out compete them with more money, but that would raise eye brows after awhile. Something has to give somewhere when supply is constrained.
The only real solution to the gender gap involves fixing the talent pipeline and then waiting N years for the talent to start coming through. Everything else is just a stop gap that is bound to create distortions.
It would be different if there was lots of talent that just couldn't get jobs because of overt discrimination (e.g. as is the case with ageism), but the gender gap is not that easy of a problem.