The West has had years to criticise Museveni for rights abuses. The fact that condemnation is only coming now, and over gay rights, plays right into the wily old president's hands.
Governments have always had a grubby habit of getting involved in their citizens' sex lives. But it is a relatively new phenomenon that sexuality is now part of foreign policy.
In the past few months, we have watched the peculiar spectacle of Russia and the United States transposing their geopolitical antagonisms onto a struggle over gay rights in Russia.
And now we are seeing a similar proxy battle unfold in Uganda, with Ugandan leaders using homophobia to assert anti-imperialist politics while their Western counterparts paint their criticism of it as indicative of their deep conviction in human rights. However neither posture is genuine.
Before President Yoweri Museveni signed the Anti-Homosexuality Act yesterday, homosexuality was already illegal in Uganda - one of the many sorry hangovers from British colonialism. But now sentences are harsher and activism on the issue has been outlawed. Discussion of the bill has led to an increase in homophobia and Uganda's LGBTQ community is right to be afraid now it has passed.
In finally supporting the bill - it's been knocking around parliament since 2009 - Museveni adopted a strong anti-imperialist stance.
He invited the world's media to the bill's signing and told them that he is prepared for a "collision" with the West over the new law. He projected the homophobic law into the domain of foreign policy and claimed that Western support of gay rights is a form of "social imperialism".
Predictably, the international community has responded with outrage. The US is conducting "an internal review" of its relationship with Uganda and President Barack Obama has strongly condemned Uganda's homophobic legislation. Meanwhile the EU has condemned the move, as have the UK's Foreign Secretary William Hague and International Development Secretary Justine Greening.
However, while Museveni's anti-imperialist stance in signing the bill and the West's human rights-supporting response have been notably dramatic, they have also - more importantly - been notably inconsistent.
It's easy enough to see the farcical contradiction in Museveni's anti-imperialist posture. He has been in power since 1986 and has been a staunch ally of the West - politically, economically, militarily - throughout his rule.
What may be more difficult to see is the similarly farcical inconsistency in the West's support of rights in Uganda. The anti-gay bill is hardly Museveni's first, worst, or likely to the be his last, assault on human freedoms.
Museveni's military has committed crimes at home and abroad, including resource pillage in the eastern Democratic Republic of Congo. He is anti-democratic, having ruled for 28 years, changed the constitution, run flawed elections and arrested opposition figures.
In his most recent term in office, his government has attacked peaceful protesters, faced major corruption scandals, severely limited the right to free assembly and political protest, increased state surveillance, and brought in a law that allows the police to arrest women for the clothes they wear.
Little if anything was said loudly and publicly by Western leaders in protest over these issues.
Neither Museveni nor Western leaders have been consistent. And while both may believe much of their own rhetoric over the Anti-Homosexuality Act, the fact that they are only saying these things now points to deeper and more concealed motivations and shifts.
In both cases it boils down to domestic politics. Museveni will gain support - both within his National Resistance Movement and in the country at large - for the hateful law.
Meanwhile Obama and co hope to burnish their liberal credentials and keep a key constituency at home happy by vocally criticising the bill.
However in both cases, it maybe Uganda's LGBTQ community that loses out. It is obvious that Museveni's actions are incredibly damaging to this group who will now be persecuted further. But what is perhaps less clear is the possible negative effect that Western responses will have on the community - the very people they are supposedly supporting - too.
In an interview earlier this month, prominent Ugandan gay rights activist Frank Mugisha told Think Africa Press that he appreciates outside support but fears further scapegoating if aid is suspended. Western rhetoric and actions, he fears, could help promote a further backlash.
The West must take some responsibility in this. While everybody should condemn the hateful legislation, Western politicians' inconsistency in condemning rights abuses limits their strength when they do condemn them.
Furthermore, the West's silence up until now plays perfectly into Museveni's hands. In signing the bill, Museveni suggested that the West is so upset about gay rights because they are trying to promote homosexuality.
Given the lack of criticism over Museveni's other egregious acts, many Ugandans may decide that their president is correct.
Moreover, the fact that the West is breaking its silence over the issue of gay rights means that any future criticism for other abuses runs the risk of being seen by Ugandans through a bogus "promoting homosexuality"/"social imperialism" lens. Not only does this limit the efficacy of supporting rights but it also puts the visible LGBTQ community in Uganda at greater risk.
Homophobia should be condemned in the strongest terms and the anti-gay bill is a hateful piece of legislation. But too often, the West has used the universal rights rhetoric as a political tool, whether for increasing support at home or to aid some other strategic interest.
This inconsistency - or phony solidarity if we are being cynical - doesn't help Uganda's gay rights struggle, it certainly doesn't help other rights struggles, and it could lead to further victimisation of an already victimised community.
Western politicians have had years to put serious pressure on Museveni's regime for a number of rights abuses. Doing so loudly on this issue - one of Museveni's choosing and one over which Western pressure could in fact boost his domestic image - doesn't make up for lost time. In fact, it could make things worse.
A version of this article was also published on Independent Voices.
James Schneider is the Editor-in-Chief of Think Africa Press. He read Theology at the University of Oxford and has a particular interest in the study of political economy, capital flows, and equitable development.
He is also a frequent commentator on African affairs for Monocle24 radio and other media. Email: email@example.com. Follow him on twitter @schneiderhome.