Okay I know from both are standpoints that we'll never agree on why God is allowed to judge and punish.
Also will highlight that while I don't hold the belief that everything in the OT was seen as rubbish after the coming of Christ and his teachings to fulfil the law, which was laid out in the OT; that in the OT people had to atone for their sins and were punished, although God did forgive and bless the people as well.
Christ died for our sins and received the punishment we deserved, however for the people of Israel and the other nations in the world, they were held accountable to the law that God had presented to Moses.
Also while Christ came to save all people, the OT specifically follows the people of Israel as God's chosen people, as he nurtures them and guides them down the line to the birth of Christ from the line of David.
Hope that makes sense, even if you don't agree
So at the end of 1 Kings 22:51 we read that:
51 Ahaziah son of Ahab became king of Israel in Samaria in the seventeenth year of Jehoshaphat king of Judah, and he reigned over Israel two years. 52 He did evil in the eyes of the LORD, because he walked in the ways of his father and mother and in the ways of Jeroboam son of Nebat, who caused Israel to sin. 53 He served and worshiped Baal and provoked the LORD, the God of Israel, to anger, just as his father had done.
It is from this that the story moves into 2 Kings. The purpose of this book is to demonstrate the fate of those who refuse to make god their true leader and follow Him in action and in their hearts. So it was written to warn and to show God's wrath towards those who turned from him.
(I know you think that God shouldn't be allowed to command us, if he actually exists, but this is the perspective from which it's written)
The worship of Baal meant that the people led a hedonistic lifestyle that centred on war, cruelty, power, greed and sex. While these leaders and kings had Gods law, priests and prophets to guide them they turned away and sought priests they could manipulate to speak to their advantage and justify their selfish lifestyle.
It is because of this immorality that god punished the people.
The rest of the book of 2 Kings does show what choosing to sin gets the people, especially the kings and leaders. However it also shows God's mercy, forgiveness, love and patience with them as well.
I know you google etc to find the 'extreme' sounding bits
but maybe read a bit more of the book and place some of these verses in context? Might help explain them to you