People are not globally aware enough to seperate Norway, Denmark and Sweden into seperate societies. So it's easy to confuse/combine the Danish "Hygge" (meaning: Cozy), Norways wealth, and Swedens generous social systems (especially as they relate to summer vacations and parental leave/rights).
As such, Scandinavia (where Sweden is for some reason the most popular stand-in name for Scandinavia - probably because it used to dominate the region) is seen as a mythical place where everyone is happy, wealthy and that the lifestyles are cozy.
Yes, there's some marketing in that, just like there's marketing in the idea that the US is free when it's ranks pretty poorly in freedom globally, or that the UK is a world power, when in reality it's about as globally important at this point as South Korea or South Africa (which, is not an insult as they are medium powers on the world stage and not insignificant).
Remember, companies operating globally from any given country will lean in to what they think that country is known for. You can see it a lot with "Swiss-Made" products, especially privacy products, when in reality there aren't any decent privacy laws in Switzerland- people just remember the banking sector permitting numbered accounts because they saw it in media. -- so these things get reinforced over time, by products marketing themselves as "Scandinavian" and then presenting a lifestyle in advertising.
If you're a (non-wealthy) student from the US, it's easy to see how you'd get that impression based on what its like to be that person in both countries.
In Sweden, you study full time, live decently and optionally have one job that you do spare time to reduce your future debt that most likely won't be a problem given that it's a (compared the US) small amount of money and you're able to pay it back relatively easily.
What I've heard from a total of 3 students from different parts of that states are some variation of: "Outside of my (full time) studies I juggle 2-3 part time jobs, barely making rent and the mountain of debt that awaits me is giving me crippling anxiety".
Of course living here is not without its struggles. We, just like the rest of the world, struggle with insane housing costs, stagnant wages for working class people, our food prices are several times higher than in the US despite us making way less etc.
And the truth it's the Southern Spain and the islands are full of Brits and Germans.
Per capita there are a lot of Nordics in southern Spain and Canarias.
If there's one thing I and other Scandinavians always seem to agree on, it's that Scandinavia sucks less for just living your everyday life in, compared to most other countries. Especially true with typical vacation destinations such as the ones in your examples.
And this carries over to almost everything, healthcare, education, job opportunities, entrepreneurism. Not quite the best at anything, but somehow average to very good at everything.
If this "complaining" attitude wasn't a thing you wouldn't be seeing right-leaning political parties rising here. Maybe it is this attitude that keeps the services and institutions working well? I don't know.
I remember a former coworker who complained so much about everything Swedish (from culture, to weather, to people, to institutions, to government). He travelled quite a lot but only ever stayed in the big centers or touristy places. He got enamored with China and thought things were so much better there in every respect compared to Sweden, he took a few months off to live there (considering moving permanently) and came back completely disillusioned. Classic case of only seeing the good parts of other places.
One thing that he actually complained about that quite surprised me was that the trains in China were overcrowded and people were rude in public transport. That was like the one thing I thought China was better than Sweden (because of their overbuilt infrastructure).
Another one that happens a lot when I tell stories about my home country ends up with me saying "what trains? There are no trains!"