Denmark is about as socialist as any left-leaning country in Europe. They just have a small, relatively fragile economy that can't sustain the massive levels of immigration they've experienced, and are reacting to it by invoking [horrors!] common sense.
And there is no love lost between the Danes and the Germans. Old wounds heal slowly.