I felt sorry for those who had to live in those countries as gay
Judging by your reasoning, you are not from an Arab country. In your country, such laws seem wild. And they consider such laws to be the norm. And homosexuality with them, on the contrary, is considered not normal. That's why the laws are like that.