He can forgive and would have if the people had asked for it - as it is they didn't. It's not like they didn't get what they deserve or that God hates them. He hates what they did and their ignorance of him - they separated themselves from God and sealed their own fate.
Such destruction were acts of love, and also of judgement. His orders were out of love for His people and His promise to them. And his judgement was of those who choose Satan over Him. God was granting them their wish - complete separation from Him.