An incident where power was taken to rule a country just because you could without any great moral basis was probably Pinochet in Chile, not many examples of this case exist.
As near as I can tell, he started from "Take over the government" and surfed his way there by reading (and stoking populist energy)
I guess this is more or less the reason. They probably see themselves as the first line of defence in internal security unlike at other democratic countries.
The repeated military intervention in internal matters has set off a positive feedback loop where those capable enough and wanting to bring positive impact join the military. So remaining institutions (civil services, police, law& order, politics etc.,) continue to erode and get more corrupt.
Maybe the generals just think they'd like to run the country for a while, and they've promised their colonels positions of power, and the colonels have promised their lieutenants promotions, and so on all the way down.