Our health insurance - an important part of our welfare system - started out as a guild benefit for workers, then it were a part of unions and finally something on a national level (I skipped a few steps).
The absolutely must have part is "solidarity". What does that even mean? It means you feel part of something tight where you owe the others, in that "something", your help and compassion, even financially.
Ethnic homogeneity isn't needed, but solidarity is. It is a feeling nurtured and grown over many years and it is easily broken if abused. It requires eternal vigilance, to keep that feeling of "we owe each other" alive despite all the distrust.
It is a constant battle against unpleasant emotions and real abuse, and you need to pick the fight in a way that ensures that you can win it. Denmark is almost too big to keep that alive.