Nature (or God) does not frown on strife, or hatred, or anger, or deceit, or on anything at all urged by appetite. - Spinoza
Spinoza resolved the debate that had raged for millennia on the nature of morality with a very swift fatal blow to the whole convoluted issue. In a nutshell, Spinoza says that what is good is what is good for you, and what is bad is what is bad for you. But this is not simply a process of lying and cheating, and maybe even murdering for one's own advantage since these acts imply a state of inner pain for the person who commits them, and as such the state and the associated acts are not beneficial. We also need to add to this the destruction of the common good that would take place if such actions were commonplace, and so Spinoza advocates that we build a state which imposes controls over destructive behavior. It's all very simple and straightforward; we come to understand ourselves and our environment sufficiently that we do not harm ourselves and we do not harm the broader environment in which we live, which in turn would have rebound repercussions.
We need to compare this cold, hard, analysis with the confusing discussions that preceded Spinoza. Plato in the Euthyphro creates a dilemma that is not easily resolved. If God lays down the moral code and we are then obliged to obey it, how do we know what that code is, and what if the dictates go against our own sense of right and wrong? In both the Bible and the Quran there are commandments that certain people should be killed. How do we know this is God's will and not that of the author of the scripture. Then again it may be that God simply approves of what is moral - the actions that are moral having a separate existence from God. This implies that God is then constrained to approve things in a predetermined way, and as such is no longer God since he is complying with something outside himself. All of this is easily resolved. Take God out of the equation and simply consider what is best for human beings at an individual and collective level. In fact, the idea of an ultimate lawgiver complicates the morality issue considerably.
Saint Thomas Aquinas came nearer to Spinoza with his notion of the Natural Law. According to this we come pre-loaded with the laws that lead to moral behavior. The first of these laws insist on personal survival, the next on procreation, then the sound education of offspring, and so on. This is fine until a person cannot have children, or does not want them. And what exactly would a sound education be? Prescriptive moral codes of this nature always run into problems, as did that of Kant with his categorical imperative. This says that we should only do the things that we would be happy for everyone to do in a similar circumstance. We obviously would not want everyone to lie to us, so we should not lie. But is comes unstuck in some situations. What is someone with a gun knocks on your door and asks if your partner is in. You would be foolish to say yes given the threat, but to say no would be to lie. I think we would all lie if our partner was in the building, and say that he or she was out.
Nietzsche added to the whole debate on morality by insisting that morality is nothing but the modes of behavior approved by the most influential group of people. He highlights the morality in the Judaic/Christian tradition as the morality of an oppressed people, as the Jews were. Charity, meekness, humility, and the likes, he saw as the morality of the weak.
Ultimately I think Spinoza is the clearest thinker in all of this. Forget any God-given moral codes and simply do what is to one's own advantage, bearing in mind the broader implications of what one does. It's simple, but then again philosophers don't like simple because it undermines some of the sophisticated nonsense they love to discuss.
Please note: I also have a Patreon channel if you enjoy this kind of content.