And it must be marvellous to go there, to a touristic area, just for a while, living in a bubble where you do not have to deal with the harsh reality of the country. Most Latin America has such a destinations and locations even in relatively violent cities. However, that does not speak of the country, but of the way things can be when you actually want to have peace for the tourism that brings in foreign currency.
You can also argue that Mexico City is marvellous because you got Colonia Roma and it is OK if you do not go to Doctores.
What you are missing out is in two parts. One of them is the area that is touristic could be the place you decide to live, even though the nation as a whole is horrible, they do not touch those places because they want foreigners to come in and spend money and leave which is why even though the nation itself could be bad, those areas are untouched by bad stuff to make it look like they are a good place.
Secondly every nation has its troubles, obviously not as horrible as El Salvador and they are at the bottom of most lists, but if you are living a horrible life, barely surviving in USA and you want to move to El Salvadors touristic place to live rest of your life not caring about money and having a better life, there is a "chance" you can do that. I rather be living like kings in a horrible nation then be starving to death in a great nation honestly.