God's aim is the happiness of his creatures through following the righteous ways and not twisted ones. But God punishes who commit serious sins on land or in the other life for God is treating all His creatures with justice.
God forgives us if terrible mistakes are committed because of ignorance and not for those offenders doing sins deliberately. In brief, God is the Great Merciful and mercy us if we seek walking under the sun with purity and eliminate evil. There should be justice on land and in the Judgement day.