Scandinavia is far from socialist. The easiest way to describe it is as a kind of "pragmatism". They do what make sense macro-economically.
They are only socialist in the most basic ethical sense: Create most good for most. That's the purpose of society and the state.
HOW they do it, is of less importance. Ideologies of both capitalism and socialism are subject to whatever works to reach that goal. Sometimes socialistic ideas does the trick, other times, capitalistic ideas. The goal remains the same.
If giving people health care can make them go to the doctor sooner, get them back to work sooner (to pay taxes and sustain themselves), then it makes sense. If criminals can be turned away from crime, that's cheaper than putting them into jail again and again. So the focus of the crime politics is not revenge, but to "fix" them. (and it works better than in any other place on earth. The terrorist is another discussion.)
Since the politics and society are really stable, we don't see the extremely hard fronts like other countries. This makes it easier for politicians to turn around and do the most sensible thing. Now, it's not perfect, by any means, but it is certainly better for most people than almost anywhere else.