We regularly see militaries seize power from Democratic governments (Egypt). In some countries, military ruled for decades (Spain), in some countries military has considerable influnce on the decision making process (Pakistan). In some countries military becomes savior(zimbabwe). In other words, military's influence is either a probability, or a reality.
Why don't countries keep provision of the military to become 4th pillar of the state (other three being: executive, legislative, judiciary)?
In that way, a civilian government's power could be checked. For instance, Bangladesh is suffering from the side effect of democracy.
It can also be a fail safe measure in case of emergency and crisis. For instance, Bangladesh suffered several crises in the democracy regarding the caretaker government.