In the ancient greek world male homosexuality was common and didn't attract the same scorn as it did even 100 years ago. So 2,000 years ago, it was acceptable, and 100 years ago it was unacceptable. When did it change? Why did it change?
It is important to note that the modern Western conception of homosexuality as an essential property of a person did not exist in Antiquity: men and women might perform certain acts, but everyone was expected to marry the opposite sex and procreate. No "deeper" theories about these inclinations were entertained, at least not by most. One "was" not homosexual, just as one "is" not a traveller now: some just like to travel more than others. It is probably still like that in most of the non-Western world. The modern Western conception probably only emerged in the 19th and 20th centuries. Foucault's History of Sexuality may be an interesting read.
In Athens, a form of flirtation that sometimes led to sex (the frequency and extent of this are not entirely known) between a bearded man and a beardless boy was quite common in the classical era, at least among the elite (little is known about the others). The man was supposed to teach the boy and introduce him into the right circles. Parents of the boy often encouraged this. There were certain rituals to this flirtation, such as the presentation of gifts to the boy. A rooster was ironically a traditional gift. A good introduction would be Dover's Greek Homosexuality. It also contains many pictures of vases that evidence this practice:
Source: Wikipedia on Pederasty in Ancient Greece: "Pederastic scene: erastes (lover) touching chin and genitals of the eromenos (beloved). Side A of an Attic black-figure neck-amphora, ca. 540 BC."
However, sex between two adult men was frowned upon, especially the kind that involved one man's acting the part of a woman. It was feared that a man who had allowed another man to so satisfy his desires upon him had compromised his manhood and was no longer an independent citizen capable of fulfilling a public function, as evidenced by Aeschines' speech Against Timarchus. Some sort of moral corruption was involved, and conceivably the unfitness of a man considered susceptible to blackmail, because of the social taboo. In other Greek states of the time, practice differed from certain forms that were socially acceptable to general condemnation. Various forms of love and sex of course took their course independent of these taboos as well. Note that what we know is mostly about the upper strata of society. This applies to any age before the modern era.
In the Roman Republic and Empire, various forms of love and sex existed, and in certain artistic and powerful circles it was often not uncommon for a man to take boys as lovers; but it was never as common as in classical Athens, and various laws and cultural shifts made people more and less tolerant in varying waves over time.
Christianity probably had a major influence in reducing this tolerance, though the powerful and the well-connected could and did get away with sometimes-open homosexual lovers; but of course they married a woman. Somehow these affairs were often between a powerful older man and a younger boy; whether other relationships were just never displayed in public or this was a certain natural preference for most older men, I do not know.
With the advent of Protestantism and its focus on conscience, and the inevitable Catholic Counter-Reformation, it is conceivable that intolerance and the severity of punishment grew. But, again, love and sex always happened in private. It is just public tolerance that was at an all-time low.
It was only after the Enlightenment that some signs of the modern conception of homosexuality can be seen, though I'm not sure when exactly. A certain tolerance that came with liberalism and enlightenment had its effect on all kinds of taboos.
As far as I know, the important change here was Christianity that spread out in Europe. The common justification to condemn homosexuality is the biblical Sodom and Gomorrah story. The dominant Christian interpretation of the story views homosexuality as the sin that caused the destruction of these cities.