The selfish gene theory is not a theory about selfishness in the everyday sense. It is a theory about the evolution of behavior.
Sun don't shine forever, but as long as it's here then we might as well shine together.