Judaism believes that while the complete set of commandments was given by Moses to the Jews, there are a few universal laws expected of non-Jews too (known as the Seven Noahide commandments). Genesis Ch. 2 says "therefore a man shall abandon his parents and stick to his wife"; our oral tradition (written down in the Talmud, KiddushinSanhedrin 58a ) tells us that means that only people of opposite gender should have sexual relations.
Now the why, and how exactly that gets weighed against other things, is beyond us (see the book of Job); but you'd asked about Sodom, again, Jewish tradition says it wasn't about the sex, it was about a society that had made callousness the law, and used rape to enforce that ban.