Born on 24 August 1930, Wagner earned his medical degree at the University of Copenhagen in 1958, after which he completed a doctorate at the Institute for Advanced Study of Human Sexuality, and took an internship at the Trinity Lutheran Hospital in Kansas City, Missouri, United States, followed by a research position at Rockefeller University.