A lot of people seem to believe that religion is necessary for morality, but there are lots of reasons why species and cultures would evolve morality. One of the best explanations I’ve ever read is in “The Selfish Gene” which is a 40+ yr old biology book. I really recommend everyone reads it, it’s amazing.
One of the most common reasons put forward to develop morality as a species is reciprocity. If everyone is just out for themselves then progress is almost impossible. One of our biggest advantages as a species is how well we co-operate. Everything in our society is built on co-operation. Maths, engineering, science itself are all possible because as a species we have worked together to improve them.
Another reason for morality is that at a basic level genes want to benefit copies of themselves, so your genes program you to be nice to people who have similar genetics, i.e. your family. Giving them a leg up in life means that your genes also have a higher chance of propagation.