Your line of reasoning is similar to "where does food come from? The grocery store, obviously!"
The underlying question is not how YOU got your moral compass but where do the people who taught you yours - and eventually society as a whole - get theirs.
If it's a set of principles that civil society generally agrees upon, then the rest are implementation details that will vary from situation to situation.
If it's a set of whims of the people in power and will vary regularly and constantly, then "damnation" comes from breaking today's rules.. maybe without even knowing what they are.
Your line of reasoning is similar to "Food comes from animals and plants. But where does animals and plants' food comes from?". Do you want to go all the way up to the Big Bang?
You learn your ethics from a combination of your parents and society, and you update your beliefs during your life, you share them to a younger generation. Repeat since humans acquired a conscience until humans cease to exist. That's all there is to it.
The underlying question is not how YOU got your moral compass but where do the people who taught you yours - and eventually society as a whole - get theirs.
If it's a set of principles that civil society generally agrees upon, then the rest are implementation details that will vary from situation to situation.
If it's a set of whims of the people in power and will vary regularly and constantly, then "damnation" comes from breaking today's rules.. maybe without even knowing what they are.