The only scripture that we have to answer why God withholds blessing from some, and gives it to another, is a book that makes some mad and some uneasy when mentioned: The book of Job.
It doesn't make me uneasy at all - it makes me sad that so many Christians cite it as an example of how wonderful their god is, without apparently considering the book at all.
The book says (as you say) that your god can do what he wants with man.
It says that - when someone challenges him - he will happily dish out all manner of terrible events on someone who was trying to do everything right.
The book tells us that whatever you do to make god happy, if it suits his purpose, he will slam you down.
For me, it's comfort. I know that no matter what happens to me, I don't have to worry about it because God will work it out.
Tomorrow, the adversay will go see your god and say "you know what? The reason the whole Job thing didn't work it because we didn't take it far enough. Betcha if I went for ralonx, I could unleash enough hell on him to make him question you".
In your understanding, what would your god do?