Boyboy have a very good video on Pine Gap where they talk about this exact issue at the start: https://www.youtube.com/watch?v=XHMa-Ba-2Mo
When Gough said they wouldn't join in the fun overseas wars, the CIA bugged cabinet meetings and did all sorts. After Gough threatened to close Pine Gap, the Australian Governor General at the time (a supposedly entirely ceremonial position) worked for the CIA (which we only now know due to leaked documents). The Governor General just straight up sacked the prime minister despite having a parliament majority. Just that easy.
Even if you don't believe the CIA involvement, at the absolute most innocent this was an incident where a very pro-Western unelected ceremonial guy, with completely private communications with US and UK governments, dismissed a democratically elected prime minister and installed a new one. It was a coup, by definition.