I have to imagine Sundar was flooded with emails saying "fire him or I quit."
I also imagine there were less-incendiary ways for him to propose his viewpoints. He could have left out his obviously-controversial "facts" (which most people with common sense, I claim, would know were gonna piss people off), or he could have talked directly to HR or his manager or even to Sundar about the diversity policies. The way it played out, he chose probably the most explosive exposition and forum. So Sundar had a right to fire him just on those grounds: not for the opinions expressed, but for the effect of enraging the entire company, and likewise for not having the common sense NOT to piss off all your co-workers. In fact, he did say the firing was for creating a toxic work environment.