Most of the major coups that come to my mind are the military preventing a government with a very extreme ideology from taking a country past the point of no return.
Usually it's something that takes place when the military itself is getting infiltrated and it either needs to act or be taken over by the ideology itself.