We’ll never truly know. But one theory I’ve heard is that behaviour which makes you more likely to survive becomes morally charged. This may be because it’s misinterpreted as a punishment /blessing, or could be that by making it a moral issue, you can increase the likelihood that people do it. Or maybe the causal relationship is reversed, and those who make it a moral issue are more likely to survive, and pass on their morality.
For example, Judaism is thought to have forbidden pork, because in that climate, pork goes bad very quickly. Eating it would make you sick, and so it became forbidden. There are a number of similar rulesvin various religions which seem to stem from ‘this rule is a smart rule to have based on our environment’.
In a similar way, clothing has a lot of very useful benefits for us. Protecting us from the cold, and from the sun, acting as camouflage, and even showing off our hunting and stitching skills to potential mates. So maybe it became morally charged in the same sort of way.
Edit: Spelling
Latest Answers