That is a mistranslation though, the article used for the ‘another man’ is the feminine one, which is believed to have a diminutive meaning. Which is to say, the 'another man’ is probably a child, which makes sense considering what was happening close by in Greece at the time this was written.
Additionally, the more complete version of this quote is “A man who lays with another man like with a women should be stoned”. Now, It’s important to know that when the bible says “lays with someone” that always means sex, and due to the culture of the time, very often also means rape, since the consent of the one being penetrated was not considered notable. (Women were objects to be owned, etc.)
Additionally, being penetrated, even in places like Greece which didn’t ban gay sex, was considered extremely shameful and humiliating.
This could therefore also be interpreted to mean “Don’t humiliate other men by raping them”.
Remember, people at the time when this was written did not think homosexuality is a thing that exists while the people who translated it were very much homophobic and bigoted, as usual for their time.
