Of course you are spot-on when you write that "Americans should perhaps not be too smug in opposing the Ugandan law" proposing life imprisonment for being gay and imposing a duty to report homosexuality on the community at large.
But the rationale for the admonishment goes much deeper than our own history. It has been widely reported that much of Uganda's recent fervor for passing such harsh laws has been instigated and encouraged primarily by religious zealots from the U.S. See, for instance, the much-honored documentary, "Call Me Kuchu."
Hate is a shameful export.
Michael C. Donaldson