Maybe a better name for this thread would be 'What's the source of our instinct/choice to practice morality?' Which kind of brings up the question 'is morality an instinct, or a choice (are people inherently kind, or cruel)?' Anyway, I think there are a lot of reasons we bother following rules or having any affection for someone without an obvious advantage to ourselves:
1. Divine punishment/reward; like karma, or an afterlife. A higher power, a god of some sort affecting you, positively or negatively. Probably more of a choice than instinct in most cases.
2. Legal punishment. Nobody wants to risk being caught and experiencing that immediate, tangible discipline. Plus, a lot of crimes are dangerous in themselves, so a threat to both life and comfort. People who do commit crimes often think they can evade the law, or just don't consider it as a factor.
3. Punishment or reward from other people involved. Like if you suddenly punched someone in the jaw, they wouldn't be very friendly toward you afterwards. They might become dangerous. If you pay someone back the money you owe them, you will gain trust and have a better chance of being lent money again. When you are polite and build friendships, you have more of a social cushion.
4. Conservation of genes; i.e. oxytocin released in mother's brains when they have a newborn child, giving them a compulsive need to protect them and nurture them. That's just natural insurance that every species has as a system of survival. So the desire to love, help, and shelter relatives is pretty easy to explain.
5. ???
There are some things that don't seem to have any advantage to us, short term or long term. Say, for example, you saw an old lady you had never met before trying to move heavy crates, so you help her move a few (specifically if you were an atheist and didn't expect a reward from anyone, earthly or otherwise; and, yes, there are atheists who are very selfless people). There's no real benefit, you just get a warm, satisfied feeling (cheesy as that is). Or when you watch a gory movie and cringe when your favorite character gets mauled. When you pet an animal (that will never give you anything back but fairly simple affection) just to hear it purr. I don't know, maybe it's resonances from instincts to preserve our genetic makeup and comfort left over from an old compulsion to survive. Maybe people are good.