Consider this song from the 12th Dynasty, written around 1900 B.C., when the religion based on the resurrection of Osiris was all the rage:
This goodly destiny is fulfilled
The body perishes, passing away,
While others abide, since the time of the ancestors
The gods who were aforetime rest in their pyramids.
Likewise the noble and wise, entombed in their pyramids.
As for those who built houses, their place is no more.
Behold what has become of them.
I have heard the words of Imhotep and Harzozef,
Whos utterances are of much reputation:
Yet how are the places thereof?
Their walls are in ruin, their places are no more,
As if they had never been.
None cometh from thence
That he might tell us of their state.
That he might restore our hearts
Until we too die.
Let the heart dwell upon that which is profitable for thee.
Follow thy desire while thou livest.
Follow thy desire and they pleasure
And mold your affairs on earth
After the mandates of your heart,
Until the day of lamentation comes to you,
When your stilled heart cannot hear their mourning.
Lamentation recalls no man from the tomb.
Celebrate life, do not rest before death,
For you take nothing with you to death
And no man returns from death who has gone there.
This song stands in contrast to the worship of Osiris and the "Chapters on Going Forth by Day," better known as the Egyptian Book of the Dead. Already at that time people believed that they would be judged after death and be sent to a pleasant or unpleasant afterlife according to that judgement. Just as Christians and Moslems do today. It is believed that men acted in a just manner because they feared this judgement. Apparently fear of the government was not enough.
If you believe that, then the attitude expressed in this song is a dangerous one. If you will not be judged after death, then perhaps you will be unjust in this life. You might steal or murder or be unkind or unhelpful to your neighbors.
On the other hand, a system of social control based on nonsense about life after death is no guarantee of good people or a good society. Religions often group people into categories, allowing the treatment of slaves or woemn, for instance, to be an exception to the rules for treating peers. Religious rules can suppress the truth in favor of dogma.
And faith can be shattered, leaving people dependent on fictions morally adrift.
Note that the creator of the song does not say there is no afterlife, so feel free to pillage. Just as a community can create civil laws for the guidance of its citizens, so people who do not believe in the afterlife can be good neighbors.
In fact, I prefer people who don't believe in the afterlife. They value life, usually including the lives of others. They don't expect other men to slave away building them a pyramid. They don't dream of the mummy life. They tend to their gardens and their handiwork because that is what makes life pleasant.
I'll be commenting quite a bit about the worship of Osiris because much of what is essential about Christianity is borrowed directly from this Egyptian religion.