Durling and Martinez cite several opposing theories in their notes to Inferno 11, such as speaking a foreign language over one's mother tongue or opposing the Holy Roman Empire, but ultimately choose the traditional approach that the Sodomites being punished in the Seventh Circle are homosexual. This is reinforced by the Terrace of Lust in Purgatorio, where unambiguously gay people ("Those who are coming with us committed the offense for which Caesar, in his triumph, once heard himself reproached as 'Queen,'" Purgatorio 26.76-79) shout "Sodom and Gomorrah" (26.40).
In his Summa Theologica, Thomas Aquinas states that "the sexual intercourse of males, which we specifically call the sin contrary to nature, is contrary to the sexual union of male and female" (Q. 94, Art. 3, ad. 2). Dante borrows a lot from Aquinas in the Divine Comedy, yet he considers homosexual lust equivalent to heterosexual. Are there any precedents to this in medieval Italy or the rest of Europe, or is this a case of Dante being unusually tolerant for his time?
In the Early Middle Ages it doesn't appear that "sodomy" was a very large concern for church or state authorities, but this began to change in the late 12th century. By 1300 most of Europe had recognized same-sex relations as a capital crime.
Italian city-states provide some of the best sources for investigation into this issue because they set up special courts to deal with sodomy cases, providing us with documents. In Florence, there were 17,000 cases dealing with sodomy were put before the court between 1432 and 1502. This represents a pretty large number given that the population of Florence was about 40,000.
The nature of the cases is interesting. They mostly involve a young male and an older man. Typically, the younger man is described in terms that are traditionally feminine, but not the older man. The implication seems to be that while the older man had committed a transgression, he had not compromised his masculinity. Actual executions for the crime were rare. The practice seems to have been illegal and taboo, but somewhat tolerated.