Legal just means they won't arrest/execute you for being in a same sex relationship. Same sex marriage means they state will officially recognize you as married.
There's also significant input from American Evangelicals contributing to these laws. For instance, Scott Lively an evangelical anti-gay activist, helped push for Uganda to penalize same-sex relationships with the death penalty. And Islam only makes up 13.7% of Uganda.
Sherine Hamdy, a professor of Muslim bioethics at the University of California, Irvine, notes that for Muslim women, the U.S. anti-abortion trends are worrying not only because they harm women’s rights to reproductive agency, but also because they diminish religious freedoms, since Muslim religious ethics make a strong case for women’s well-being taking priority over that of the fetus. [emphasis mine]
This means that Americans in states that effectively outlaw abortion, including Alabama, Arkansas, Missouri, Oklahoma, and South Dakota, will have fewer human rights protections than those in Iran or Saudi Arabia—countries that are often vilified by politicians across the ideological spectrum for their treatment of women. Iran, for example, allows abortion in cases of fetal impairment, and Saudi Arabia allows for abortion when the health of a patient is at risk—including mental health, which can function to allow for abortion in cases of rape or incest—contrary to only the narrow “life” or “medical emergency” exceptions that are now increasingly common in state bans in the United States. [emphasis mine]