This is a question which has been asked for centuries, but is there any definitive answer even now? The most common debate is that of relativism and absolutism, whether there are things which are universally right and wrong at all times for all peoples, making morality objective, or whether everything is relative, either culturally or individually, and therefore subjective.
Morality presupposes freedom. If we are not free, then there is no actual morality, just an idea of what it should be like. There is no doubt that societies cannot function without this idea of freedom, otherwise the judicial system would collapse, since nobody could be blamed for anything, since no actions are made freely. However, just because societies would not be orderly without the concept of freedom and objective morality, this does not necessarily mean that freedom and objective morality are actualities. Free will may just be an illusion, and merely provides a basis for responsibility and a system of justice, as well as our brains tricking ourselves into thinking that we are making choices when really we aren’t.
Again, the objectivity of morality seems somewhat absurd. How does one know what is actually right and actually wrong? The general claim is that morality comes from God, thereby making it objective, but what kind of morality is it that comes from God and how do we find this out? There are so many different interpretations of scripture, and religions differ and oppose each other constantly in moral beliefs, all claiming that their own morality is the divine one. It seems to me impossible to reach past our subjective nature to any objective truth about morality. Even if there was a right answer as to what to do, how would we attain this answer without the trouble of subjective interpretation arising?
Morality keeps society orderly and maintains a system or justice, but this system of justice seems based on a set of subjective principles which are then proposed as objective from a standpoint of power. A moral statement seems to be a preference or opinion put forward as a fact. Yet this solves nothing, and the question of what is right and what is wrong may go forever.