Did monogamy appear before religion?

Well, in pretty all societies, you can’t have everyone in a polygamous relationship. You’d need a sever dearth of males, or a large number of unmarried adult males. That may not have been uncommon after a major war, assuming the rest of the population didn’t end up as slaves.