In Europe, homosexuals have been prosecuted for ages. In most religions, sexuality is centered around reproduction. Therefore, homosexuality has been regarded as not natural, not intended by god and thus forbidden.
The case of Alan Turing
Alan Turing was a world famous mathematician and computer scientist. During World War II, he played a major role in deciphering the German Enigma code-messages, and thus helped shorten the war considerably. In 1952, Turing was persecuted for homosexual acts, which were a criminal offense in the U.K. at the time. Turing was found guilty and convicted to be chemically castrated. Turing died in 1954, probably because of suicide.
In 2009, prime minister Gordon Brown made an official apology for the way Turing was treated, and in 2013, Queen Elizabeth posthumously pardoned Alan Turing. In 2014, the movie The Imitation Game, based on Turing’s life, was released.