Swedish liberal attitudes developed during the post World War 2 era (remember that Sweden had been neutral, and had not suffered nearly as much during the war as many other European countries).
As far as American perception of Swedish attitudes to sex, this was probably formed during Eisenhower's presidency. With the international distribution of Swedish films that often featured nudity (frequently involving young couples frolicking outdoors and often in water), and (at least implied) sex scenes. The first of these was Arne Mattsson's Hon dansade en sommar (One Summer of Happiness (1952)), starring Ulla Jacobsson and Folke Sundquist.
Largely because of these films, Sweden quickly became known as
a land with malleable standards of sexual morality.
This was very different from the conservative American attitudes of the 1950s, and the effect was compounded by a report in Time magazine in 1955 by the American correspondent Joe David Brown.
Brown's report was titled Sin and Sweden [NOTE: that the link is paywall-protected. I will try to find a freely available copy of the article] and apparently created the impression in the minds of many Americans that:
Swedish teenagers were encouraged to become sexually active and that
unwed mothers were regarded as heroines
The letter pages of several subsequent issues of Time Magazine were filled with responses to Brown's article from readers who either vilified or praised Sweden's supposed progressive policies of sexual freedom.
Now, it is worth noting that the stereotype of Swedish people in America was very, very different, and often quite negative, in the decades before the Second World War. Stereotypes change, albeit often very slowly!