Religions do not change readily. Most of their dogma passes from its origins to the present day with only minor and superficial modifications. When a significant change occurs, it usually signifies the birth of a new religion.
The codes of behaviour advocated by Western religions were probably pragmatic when they were devised. Let’s look at what conditions were like at those times.
Judaism seems to have been born about 4000 B.C. On the entire planet there were fewer than 25 million people. The average lifespan of a human was about 25 years. Medical knowledge was extremely primitive. It would be reasonable to expect that the survival of any community of humans would depend largely on the rate of reproduction. Women would necessarily spend their time having children. Gays would be considered an inefficient use of genetic material.
When Christianity, the first major modification, came around, the world population had gotten to about 200 million. Average lifespan was about the same, although in some areas of the world it might be as high as 35 years. Medicine had advanced a bit. Things were not quite as desperate in terms of survival, but things were still pretty bad.
The Muslim religion splintered off about 1000 A.D. World population was 300 million, less than the current population of the United States. Average lifespan was higher, interestingly enough, in the populations where this religion developed, possibly because of medical advances.
Martin Luther happened at the end of the 15th Century. Population about the same. Lifespan about the same.
And not much has developed since.
These religions promote codes of behaviour devised for small communities under continual threat from disease, invaders, and crop failure. Their behavioural models cannot be successfully applied to today’s world, with advanced medical science, a population of 7 billion, and a world average life expectancy of 67.2.
Women live beyond child-bearing age now. There is no longer any threat that we will run out of people.
But Christianity, Islam, and Judaism still live in the centuries in which they began.