The primary role of the government is to serve its own people. No country has an obligation to spend money on foreign aid, accept refugees etc involuntarily.
Everything costs money and you'd guess most taxpayers aren't enthused of e.g. supporting foreigners en masse, having plenty of domestic problems of their own.
First, you are factually wrong: most countries are signatires of international refugee programs.
Second, in your wicked world, who helps the refugees? Who helps you when you become a refugee?
Bear in mind that most refugees are displaced because of geopolitical developments, of which rich countriss, specially US and UK, are in big part responsible.
Everything costs money and you'd guess most taxpayers aren't enthused of e.g. supporting foreigners en masse, having plenty of domestic problems of their own.