Gays and lesbians enjoy more rights in countries with a higher degree of modernisation, as several large-N analyses have shown. Why is that the case? The authors usually contend that as modernisation progresses, a change of values can be observed that includes growing tolerance for alternative lifestyles. However, they do not provide empirical evidence of this assumed causal mechanism linking tolerance towards gay and lesbians with their rights. The paper closes this gap. We test whether the effect modernisation has on gay and lesbian rights is mediated by tolerance towards this group. We believe that the effect of these attitudes on legislation on homosexuality is limited to democracies, as only in democracies government responsiveness to public preference is structurally enforced by means of electoral accountability. Thus, the mediation should be moderated by regime type (democracies vs. autocracies). To test our proposition we employ a moderated mediation analysis of 73 countries that took part in the fifth and sixth waves of the World Values Survey.