Background: Measuring homophobia at country level is important to guide public health policy as reductions in stigma are associated with improved health outcomes among gay men and other men who have sex with men. Methods: We developed a Homophobic Climate Index incorporating institutional and social components of homophobia. Institutional homophobia was based on the level of enforcement of laws that criminalise, protect or recognise same-sex relations. Social homophobia was based on the level of acceptance and justifiability of homosexuality. We estimated the Index for 158 countries and assessed its robustness and validity. Results: Western Europe is the most inclusive region, followed by Latin America. Africa and the Middle East are home to the most homophobic countries with two exceptions: South Africa and Cabo Verde. We found that a 1% decrease in the level of homophobia is associated with a 10% increase in the gross domestic product per capita. Countries whose citizens face gender inequality, human rights abuses, low health expenditures and low life satisfaction are the ones with a higher homophobic climate. Moreover, a 10% increase in the level of homophobia at country level is associated with a 1.7-year loss in life expectancy for males. A higher level of homophobia is associated with increased AIDS-related death among HIV-positive men. Conclusion: The socioecological approach of this index demonstrates the negative social, economic and health consequences of homophobia in low- and middle-income countries. It provides sound evidence for public health policy in favour of the inclusion of sexual minorities.