As others point out we did have guest works, we also had Vietnamese boat-refugees, Bosnians refugees from the Balkan wars. The thing is: there was never that many of either groups. So no, Denmark isn't a nation of immigrants, not even close.
Both left and right leaning governments have failed to implement good integration policies. The parties on the left have been to naive and assume that things would naturally work them selves out: They trusted that the people coming into the country would want to learn the language, integrate and become Danes. On the right the opposite was assume, that the policies should be to not let people feel welcome, in the hope that they would leave.
Troublesome groups are let in, because Denmark is legally required to. But the evaporation of trust in others isn't purely an immigration issue, it happens between Dane as well, and that's worse because we're not entirely sure why it's happening.