Because they are brilliant.
At face value, it is because they want to admit their issue, and do better. Excellent PR. Zero downside. I haven't read one single negative comment. People, including myself, are coming out of the woodwork to praise their candor.
What is brilliant is that GOOGLE NEEDS TO FIND AND HIRE MORE SMART PEOPLE! How do they do that? Certainly not by clinging to good old (white) boy hiring practices.
They don't care (nor should anyone else, yet many still do) if your brain and work ethic are wrapped inside a green, yellow, white, or any other color package - and why should they? They don't care if you are male, female, or some combination. They don't care if you are gay, straight, jewish, arab, catholic, or a satanist (i presume). They care that you are SMARTER than those who work for their competitors (and even their allies). They want ALL the smart people, and why shouldn't they?
So you raise awareness that you are clearly underserving YOURSELF by publicly stating that you are not happy with the diversity of your workforce. It gets people talking. It makes all the non-white males with big brains think, "wow, that was pretty ballsy of Google to call themselves on the carpet. I can respect that." Game over. Google wins.
This, and the absurdly obvious shill Google movie, "The Intern," are two of the best pieces of marketing i've seen in decades.