I have read that Allah (SWT) has allotted equal rizq for each person when we were created. And the class system prevails in the society because people become greedy and take up maximum resources for themselves creating a class barrier. And so, the middle class and lower class population suffer and struggle throughout there life for basic human needs.
My Question to you is
Why do people who pray and have a pure soul still suffer for rizq despite Allah (SWT) said that he tests people only till a person's endurance limit?
Yet, so many people have died recently because there resources were cut off due to corona virus or they did not have any and their savings were over. People suffered for basic needs like food, clothes and shelter in the extreme weather. Why did that happen?
And due to the fact that this was a worldwide epidemic so many cases came to light . But every day people die due to lack of resources, due to wars (eg. Palestine etc), shia genocide and so on.
How to look at these things ?

The general system of God is that He delivers Rizq (sustenance) to all. However, there are exceptions:

1- When people themselves commit injustice. Evil people can make others die and starve. Now God can stop them of course, but life is a trial. The evildoers will be held accountable and those oppressed will be compensated.

2- God tries us through difficulties and tragedies. Even very good believers will go through difficulty. See Al-Baqara 155. Allah tests us with loss of lives and hunger. And those who remain patient Allah will reward them and take them to heaven.

3- Such tragedies and difficulties remind us that we were not created for earth. Earth is a temporary transit hall. Our final destination is the Akhira. And the proof is that there is so much pain and suffering in earth. If there was no pain and suffering no one would care about the Akhira.

4- Such pain and suffering also teaches us to appreciate out blessings, not take things for granted, and use God’s resources justly. So it’s a learning moment.

All these points apply to this current pandemic.