One hundred years after exile, the Israelites who had returned to Jerusalem were as evil and corrupt as their ancestors. The book of Malachi addresses their corruption regarding issues like sacrifices, marriage and tithing. It also affirms that God does love His people and will fulfill prophecy.
The entire Scripture is one unified story that tells us the truth about the human condition and sin while announcing God's promise to one day send a messenger and then show up personally. He will defeat evil and purify a faithful remnant, establish a New Jerusalem and bring peace, healing and justice forever. It's that promise that prompts God's people to denounce sin, remain faithful to His covenant and hope for the future.