Despite a number of programmes to prevent HIV among men who have sex with men (MSM) and, more generally, sexually diverse populations, gay and other homosexually active men continue to be at heightened risk of HIV and its consequences. This paper analyses some of the reasons for this situation and offers policy and programmatic recommendations to contribute to a solution. The social exclusion of MSM and transgender individuals is an overwhelming reality in the majority of countries worldwide. Although progress has been achieved in some countries, in most of the world the situation remains problematic. Present challenges to equality and to the realization of health, include the membership of groups or subcultures with high HIV prevalence, lower quality and coverage of services and programmes and the impact of higher-level influences such as laws, public policies, social norms and culture, which together configure an environment that is hostile to the integration and needs of certain groups. A social inclusion perspective on HIV prevention and AIDS-related care implies the adoption of strategies to understand and confront social vulnerability. Sexual exclusion intensifies the burden of HIV transmission and morbidity. As part of a comprehensive response there is an urgent need to: (i) improve our understanding of the characteristics and HIV burden among sexually diverse populations; (ii) creatively confront legal, social and cultural factors enhancing sexual exclusion; (iii) ensure the provision of broad-based and effective HIV prevention; (iv) offer adequate care and treatment; and (v) confront special challenges that characterize work with these populations in lower and middle-income countries.