A moral code may be descended from religious moral codes, but that does not mean an atheist subscribes to that religion.
There are many aspects of the Christian moral code, for example, that are universal. No murder, no stealing etc. Some aspects of the Christian moral code are not universal and are purely religious in nature (no golden idols etc.)
Man has no interest in preserving other men unless they can be used to insure his existence.
Of course, but a smart man, whether religious or atheist, realizes that it is in his best interests to exist as part of a greater group.