Because they're applying Western ideals to a country (or more specifically a government) that doesn't share those same ideals.
Larry and Sergei were of the opinion that any information, even if censored, is better than no information at all.
> "While removing search results is inconsistent with Google's mission, providing no information (or a heavily degraded user experience that amounts to no information) is more inconsistent with our mission." [1]
They could have pulled out but they were idealistic and felt that their presence was one step towards making the world a better place. Well, that and
> The Google statement said the tradeoff for going against its basic principle of making the "world's information universally available and accessible" is gaining greater access to a quickly growing Chinese economy.
That's the general gist anyway. I forget the specifics but it's covered in a book called In The Plex[2]
[1]: http://edition.cnn.com/2006/BUSINESS/01/25/google.china/
[2]: https://en.wikipedia.org/wiki/In_the_Plex