Sondhi, the Muslim general who led the coup, is a good guy. He is the former head of Army Special Warfare and also fought alongside US troops in Vietnam. The guys has incredibly good credentials.
There are a number of reasons for the coup, but the final straw was the former PM going after the military. For the last few years, the PM was going through the government replacing high ranking individuals with his own supporters. He had been doing this with the military also and there were a few, including Sondhi, that started publically going against him.
To make a long story short, there was an 'attempted assassination' against the former PM about 6 months ago in which a car with explosives was found outside the PM's residence. The PM made a big deal out of it and started going on public attacks against the military while releasing no evidence at all. To many, including myself, it looked like the PM staged the event to grab more power.
Well, the military finally had enough of it and that is one of the major reasons things happened as they did. Of course, there are a lot of other issues such as corruption, but this was the final straw.