Having a popular developer tool that is already integrated with a lot of apps in both iOS and Android is valuable strategic asset for Google. Analytics and ads go hand in hand and as tracking cross-app behavior is hard, and having a library that is installed in many apps makes it easier.
I'm pretty sure that this was the strategic thinking when started to invest to app developer tools (Crashlytics, Fabric, Digits, MoPub). It's interesting to speculate why they are selling Fabric, is their business model focus moving away from mobile ads?