This is called Ethicalism.
Ethicalism is a belief that if you lead an ethical and morally upright life, you will be respected by people and by God. It is a common practice in Buddhism and Taoism, where followers of these religions follow particular principles based on morals and ethics in order to fulfill their lives.