This democratically elected leader has done everything to jeopardize democracy in that country. Not all elected leaders live up to the people who elected them, and when they don't, they should be deposed.
The only question is, whether the military wants to return the country to democracy, or to just take over and take Erdogan's place. It is almost always the latter sadly: I can't think of a single example of a military takeover in the modern history that would end in pro-democratic course.