If I had to give you a concise answer, I would say that God was viewed as both merciful and avenging. God could be benevolent and peaceful, as is more often depicted in the New Testament, or He could wrathful and avenging as in the Old Testament.
I think a good way to get a sense of this is to look at contemporary writings during the Black Death. It is worth noting that at the time the concept of a pathogen as we might think of it today more or less didn't exist. Academic writers - both theologians and physicians, spent a lot of time trying to figure what was causing so many people to fall ill. We'll have a look just at the theologians.
The Bishop of Bath and Wells, Ralph of Shrewsbury, in writing to the archdeacons of his diocese (17 August, 1348) decalres that 'Almighty God uses thunder, lightning and the other blows which issue from his throne to scourge the sons whom he wishes to redeem' (emphasis mine). This one sentence, in my eyes, captures the fact that God was both avenging and merciful; a sinner could be struck down by the wrath of God, but they were not beyond redemption.
Indeed, there was a sense at the time that the bubonic plague had been sent by God. The Archbishop of York writes that (28 July 1348) 'this [the plague] is surely caused by the sins of men who, while enjoying good times, forget that such things are the gifts of the most high giver.'
Notable however is the purpose of both these letters. Both serve to lay out ways in which people can be saved from God's wrath. The Archbishop of York declares that a 'special prayer [should] be said in mass every day for allaying the plague and pestilence' while Ralph of Shrewsbury calls for an appeal to God via prayers so 'that the mercies of God may speedily prevent us and that he will, for his kindness sake, turn away from his people this pestilence and other harsh blows.'
I hope this gives you some sense of the view of God as both avenging and merciful. All the letters thus referenced can be found in The Black Death, Rosemary Horrox (eds.) (Manchester University Press, 1994).