
Obligated to
In the EU if you want to be an e-mail service provider you have to keep transaction logs, including IP addresses but not containing content for a period of 6 months minimum. There were lots of bruhaha's about that, with Dutch ISP XS4ALL for one. In the end this means that "Why don't these companies simply just not keep logs" is answered by "because they can't do business otherwise". Google was legally obliged to provide the requested data in this case. It's good that Google doesn't just handle over everything whenever it's asked.
They have the right to quibble and they do.