A few explanations:
• Соединённые Штаты (United States) is plural, but Америка (America), which is feminine, is used most often outside of formal context.
• Перу (Peru) and Чили (Chile) are most often neuter when talking about the political entity, but feminine when talking about the physical country.
• Somalia seems to be in anarchy even in the Russian language. Сомали (Somalia) can be seen variously as masculine, feminine or neuter.
• There is a similar ambiguity with Тонга (Tonga) and other Pacific Islands; generally they are masculine by default.
• As someone has pointed out, Нидерланды (Netherlands) is the more formal name in Russian, which is plural. Голландия (Holland) is not incorrect, however, unlike in English; it is feminine.
• Turkmenistan and Kyrgyzstan are masculine by their official names, which are rarely used favor of the “-ia” feminine versions.
• For the UK, Великобритания (Great Britain, fem.) is the standard. Соединённое королевство (United Kingdom, neut.) is seldom used, and Англия (England, fem.) is inaccurate.
• The Dem. Rep. Congo and Rep. Congo are marked as feminine, which is correct when using the long names. “Конго” (Congo), however, is neuter.
More detailed info on gender patterns in Russian and plural countries here.