In the wake of attacks, it makes sense for a country to restrict tourist access for the safety of all involved. A total ban on entering or leaving a country could create a lot of problems, but preventing tourists from entering could probably be done in a way that minimizes negative impacts and protects the safety of all.
There always seems to be some kind of horrible attack happening somewhere. If a government prevents visitors from entering the country, it only serves to give power to the terrorist. It seems to be a fact of life these days that horrible things can happen at any time at any place in the world. All governments should work to protect the people, while keeping things as normal as possible.
No, Turkey should not ban tourism because of internal tourism. I believe that tourists should be able to choose for themselves, so long as they are aware of the risks. Turkey is already suffering because of the internal turmoil, and cutting out tourism would only hurt the economy and worsen its issues.
Shutting down a country's borders to tourists never makes sense. First, if someone really wants to get into a country, they will find a way to be smuggled inside. Turkey would end up hurting their economy and international standing by barring tourists entry into their country. Furthermore, stopping tourists from entering the country wouldn't stop future terrorists attacks. A better response would be for the country to increase its counter-terrorism resources to help prevent future attacks.