It appears that Turkey's president, Recep Erdogan, is using the failed coup attempt to his advantage by purging the government of dissenters. Since the coup failed last week, Erdogan has had over 5,000 members of the military arrested, and has removed thousands of government administrators, teachers, and judges from their respective positions. It is hard to imagine that they were all coup plotters.
The revelation that Erdogan had a list of who to purge before the coup makes it seem like he knew about the coup in advance, and is using it to get rid of his political enemies. That is basically how one would expect any leader to respond to a failed coup.
Arguably the rationale behind the military's attempted coup in Turkey was that President Erdogan has been taking every chance he can to consolidate power and needed to be removed from office. These power grabs and his Islamist political agenda chafed the guardians of secularism that is the Turkish military. With the military removed as a threat and a proper excuse in place, Erdogan is seizing power and purging the government.
There have been numerous reports that support this theory. The firing of so many goverment officials and civilians, as well as the arrest of two people who talked about the coup on social media are a perfect example. Talk of bringing back capital punishment is another example of evidence that he plans to do so.