Read this Aug. 3 post at Military.com (which compiles information reported by the New York Times and the Washington Post). It indicates the U.S. had no inkling the coup attempt would happen.
I have no way of knowing if the reported information is accurate and, as is with everything else, I am actually skeptical of it because media are unreliable sources.
Nevertheless, if the Military.com post is correct in writing stuff such as, “Back at the Pentagon on July 15, officials were clueless. ‘The people we talk to just aren’t picking up the phone,’ one official said,” then it demonstrates why it is important to spy on allies as well as enemies.
Nations might be allies but it doesn’t mean they tell each other everything that is happening within their respective borders. Intelligence collection helps fill these vital information gaps.