The following is written in response to both direct and indirect questions I have seen/heard (internet and otherwise).
I sympathize with the thoughts you have struggled with. I have had such thoughts. But consider this: If God is unjust, He is also a liar because He has said He is just. So your question is an all-or-none question.
How, then do we explain the
disease, disasters and various kinds of pain, cruelty and injustice in the world?
God did not want it that way but has allowed sinful men to create many of these situations -- the injustice for example. Disease is often the indirect if not direct result of diets different that what God had planned for us....chemicals added to soil and to foods, overprocessing of foods. Hunger problems can sometimes be traced (such as in India) to a religion that won't kill the pests and animals that they ought to control and eat...because of a religion that denies Biblical truths.
Natural disasters cannot be blamed on humans...or can they? I heard of a book that tied over 100 major world disasters in various nations to the nation's official edicts relating to God directly, or to the treatment of Israel. Remember, the Bible says that God blesses those who bless that nation and curse those who curse it. The book pointed out that over and over and over the disasters came within DAYS of the stands that national leaders took against Biblical principles. (I hope to locate that book so I can give specific examples in the future when asked your questions. One example I found on-line is this: 2008 California fires that burned down well over half a million acres of forest land came just three days after the state’s legalization of same sex marriages. Even Actress Sharon Stone asked if the 2008 earthquake in China was God's "karma" for China's treatment of Tibet and the Dalai Lama (over a million people were killed and over 100 monastaries destroyed when Chinese communists took over). . HOWEVER, we should not paint with too broad a brush and assume that ALL disasters are God's judgment because the Bible also states that God's rain falls on the just and the unjust.
I remember reading in a college textbook that the God of the Bible was "capricious" because of His having the people destroyed when Israel took over the promised land. Really? Well those wonderful people they destroyed were involved in religious prostitution and sacrificing of their children in fire to the god Molech...that much we know... I have heard they even marched those children ALIVE into the fire. Why were they to destroy ALL those people? Because otherwise the children spared might rise up to take revenge. God was patient with those tribes and cities, but the time came for judgment...for His justice to prevail.
Over-all, I see humans who judge God as unjust like a judge in a courtroom who hears the prosecutor tell his story regarding the alleged criminal, and then the judge pronounces his verdict before ever hearing a word from the defendant's lawyer. With our pea-brains we understand perhaps 1 one hundredth of the whole story regarding the perceived injustice of God in ANY situation ! ! ! How dare we pre-judge Him without knowing all there is to know about each situation and how everything will turn out at the judgment day and beyond?
We seem to think God owes every human a consistent 80 or so years of equal health, wealth, good looks, power, acceptance, love, opportunity, etc. Who says so? I long ago concluded it isn't what cards you get in this sort of game... it is how you play them. I also concluded I should not fight that other "golden rule"....you know, the one that says the guy who has all the gold makes all the rules.
I have asked many of these questions, and especially struggled with seeing people in pain in this life (even good Christians)...ongoing pain that can't be fixed. The Bible speaks to this. When we compare our time on earth to eternity, time is the drop in the bucket, but eternity is the water of the oceans of a trillion worlds. We are offered that eternity of bliss....and yet many of us say "no thanks"? Job in the Bible loved God yet had horrid, excruciatingly painful catastrophes in his life. I doubt that now in God's presence he is mad at God about the past. The bad things will all pass in comparitively short time. I do not consider this to be a full answer... just some things to think about.
But God has not just stated He is just, but that He is also loving, gracious, forgiving and merciful. I choose to believe Him, as essentially, that is all He asks. I have been disbelieved -- someone in my life has chosen to see me as FAR less than I really am in character, and it grieves me D E E P L Y. I ask, "How can they not see me for who I really am?" I have shed many tears over that. How must God feel when we judge Him based on incomplete information? I have chosen to RESERVE JUDGMENT of God until the judgment day...when He is the one judging me in fact. I am 100% confident that at that time ALL doubts regarding God's just and holy and perfect character will melt into nothingness! Instead I will be praising Him for His mercy and grace....mercy being the gift of salvation I never deserved, and grace being the remitting of the punishment I did deserve. These things go far above and beyond God's justice, and I am supremely thankful that they are a part of His character.