The people of Turkey have voted for him right? He improved their economic situation enormously, this is democracy, you get who you vote for.
This is a regular pattern with right-wing populist governments. When they get into power they institute a set of economic policies that lead to wide-spread prosperity in the short term, but in the long-term are a disaster.
As far as elections go, the government pretends to be in favor of free and fair elections, but its political philosophy is a set of arguments as to why they are a terrible idea and ought to be eliminated. Which is just what the Ergogan goverment has been attempting to do in a step-by-step fashion.