Well, you are partially correct. We are obligated to do the right thing, in the right way, for the right reason.
So, yes, sometimes the situation (time, environment, society, religion) may dictate what may be moral.
However, it must all be predicated on doing “the right thing.”.
So, it is NEVER right–no matter what society you live in–to rape someone. It is NEVER right to commit genocide. It is NEVER right to murder. It is NEVER right to fornicate.
As far as pillaging, perhaps. Raping? Not so much. As if.
Ok.
Morality is conditional. In the Bible there are things that we may consider immoral but some were God directed, and consistent with the times. I think they are immoral but I live in different times, in a different society.
Gen 38:1-6 - Judah has sex out of wedlock -
About that time Judah parted from his brothers and pitched his tent near a certain Adullamite named Hirah.There he met the daughter of a Canaanite named Shua, married her, and had relations with her.She conceived and bore a son, whom she named Er.Again she conceived and bore a son, whom she named Onan.Then she bore still another son, whom she named Shelah. They were in Chezib when he was born.Judah got a wife named Tamar for his first-born, Er.
Sam 15:3 - God commands genocide
Go, now, attack Amalek, and deal with him and all that he has under the ban. Do not spare him, but kill men and women, children and infants, oxen and sheep, camels and asses.’"
Gen 19:8 Lot offers up his daughters to the men who wanted the Angels.
I have two daughters who have never had intercourse with men. Let me bring them out to you, and you may do to them as you please. But don’t do anything to these men, for you know they have come under the shelter of my roof."
Later the daughters get him drunk and have sex with him and bear children. Moab and Ammon.
Exodus 2:11-12 - Moses murders an Egyptian for revenge.
On one occasion, after Moses had grown up, when he visited his kinsmen and witnessed their forced labor, he saw an Egyptian striking a Hebrew, one of his own kinsmen.Looking about and seeing no one, he slew the Egyptian and hid him in the sand.
Some pretty nasty stuff for my genteel sense of morality.