I am wondering which county was the worst ... Spain or France or Italy? And what about middle east (in middle ages)?
Middle Ages era is 400-1400. The Middle Ages was when the Catholic Church slowly gained more power. In the earlier part of the era, they placed strong emphasis on platonic relationships, so same-sex companionships are ok, just not sex. According to some historians, they had Brother-Making ceremonies where it's basically marrying two men. However, the more popular approach towards sex at the time was that it was mainly for procreation. This led to the growing antipathy towards homosexuality. As the Middle Ages was coming to a close, homosexuality became a crime against natural law. Not sure which country was worse, but France's punishment for the third offense of homosexual acts was burning at the stake.
I've *heard* medieval Spain was remarkably tolerant towards homosexuality among the nobility (the Islamic ruled areas, anyway), and a few visitors from France were shocked at how lax their society was towards the topic. There were rumors of King Edward II being a sodomite, but I think people's attitudes towards sex, friendship, and attraction were different back then, so the lines were blurred in terms of close male bonds. I'm sure it varied from country to country, year to year, and class to class, too. Here is a link if anyone is interested.