A CIA officer who drugged, photographed and sexually assaulted nearly 30 women in postings around the world has been sentenced to 30 years in prison.