I understand after each punishment He tells us to be good, do good so we can achieve His mercy. But isn’t faith in Him based on pure love? If I fear His punishment at all times, how could my love be unconditional for Him? I understand if I don’t want to displease God, I have to avoid the bad things that He forbade, because that is for my own good. But why would I have to be always so afraid? In a book of love and mercy, it’s hard to see such punishments, because as for me, if I love God, I would aim to refrain from those things that may hurt me.
The Mercy of Allah is His main tribute (Al-Rahmaan , Al-Raheem) that is why we are been ordered to remember His Mercy at least 40 times every day in our obligatory daily Prayers. (Sura Al-Hamd mentioned His Mercy four times and we must recite Sura Al-Hamd in every Salah minimum two times 2x5=10x4=40)
His Mercy is the reason behind our creation (But because Mercy of your Lord, and for that He created them) (Sura Hood; 119)
His Mercy on us is mentioned in hundreds of places in Quran.
What do you think about a person who denys all the mercy of Allah and opposes Him and insists on doing wrong again and again. Anything but punishment should be his result? The sever punishment is a direct result of the severe arrogance and insisting to do it again and again.
Allah , The Most Merciful does not like to punish any one but those who insist on evil and wrong deserve punishment to drive people away from doing like them. In fact, it is part of His Mercy on people is to punish those who want people to do wrong like them. This punishment secures the Mercy on people.