The simple answer is that Spanish colonialism was in charge of having the population poor enough not to rebel but not so extreme that there would not be a revolution.
When the wars of independence began, Spain was hardly even in America, the rulers had been born and raised in America,
So when the Spanish left, the same system remained, under the same rulers as before, only that it has been modified over time
The problem is that we are still wild monkeys, if they do not apply a heavy hand to us we become destructive