Why were some countries allowed to remain neutral in World War 2?
Because they chose to remain neutral But coutries like Switzerland was "suicide" to attack every house owned at least one firearm cities were/are startegicaly build hard to reach with ground force countries like Swenden and the US which sold weapons and resources to both sides were of a greater importance to not get involved in the war
This question implies that the countries had a choice. Some were attacked and had to surrender. Germany was such a threat to world peace before the war started, that Britain and France met and allowed Germany to take over control of some border land and countries. Mainly, the small countries could not resist the German Army. Some wanted to remain neutral but Germany had to attack them to get to France and England.
In Europe, the nations that managed to remain neutral were Sweden, Spain and Switzerland. In Africa, all countries were linked to either Italy, France or Britain so none of them remained neutral. The Latin American countries remained largely neutral. Asian countries were practically all dragged into the war, either because they were invaded by Japan or because they were colonies of Japan or one of the Allied nations.