It's not about proving library-like functionality. It's about providing infrastructure that their customers don't have to build and maintain.
Managing avatars has non-obvious challenges/headaches:
- uploading images, downloading from services, and processing images to the right size should happen asynchronously. That's not easy in every web framework, and even when it's easy, it's mean you have to manage that infrastructure.
- you might want to periodically update your avatars from Facebook/Twitter in case your users change theirs
- sometimes you may have to retry downloading avatars from Facebook/Twitter
This is the point of all "cloud" services. Some people think "I can run Linux on my own machine, I don't Amazon EC2", and that's fine, but obviously there is a need for services that provide or hide infrastructure. Some companies, like startups for instance, are willing to accept the risks that external dependencies have to attain the benefits of not having to manage the infrastructure.