I didn't find it to be defending the CIA's failures in any way.
The CIA didn't call Trump its adversary, the reviewer of the book did. They also said that Trump was the Agency's adversary, not the other way around. It is also possible to be adversarial against an individual while doing a good job working for them (see for example everyone with a boss they don't like).
I wouldn't read too much about the intentions of the intelligence community into that provocative sentence by an unaffiliated book reviewer.