A - Thanks for the question! The first thing we need to understand is the progressive way that God has revealed his nature to us. I have frequently heard about the difference between "the Old Testament God" and "the New Testament God" as if there are two different gods. But, this is certainly not the case. There is one God who has slowly revealed his nature to humanity through the ages. The complete understanding of God's mercy can only be seen in God's son, Jesus, giving himself up for us.
God cannot change. But, our understanding of Him certainly can.
We must also remember that while God is merciful, He is also just. If we so choose, we can live a life apart from His love and if we die apart from that love we will certainly have earned eternal punishment. In fact, Jesus warns of hell more than he talks of heaven. We could call this a "tough love" approach. Just as a parent has to teach a lesson the "hard way" sometimes, because the children just won't listen to reason, so God has had to deal with His children throughout time.
With this in mind, it might be the best way to understand what happened with Sodom and Gomorrah. Remember that God sent two angels to look for those in the cities who were righteous. Those righteous people (Lot's family) were spared. Thus we should see the text to be just as much about God's mercy as we do it being about judgment. When the people sought to have sex with the angels it sealed their fate(by their unrepentant and sinful attitudes).
I hope this helps.