Again, it appears if we approach this story and make it first and foremost about ourselves and our situations, then we are doing ourselves a tremendous disservice. The interpretation that follows this myopia will also suffer, too, it seems.
Remember, the challenge posed by satan is that Job would curse God to His face if he were to suffer. In the end this **never** happens. Job maintains his faith through his trial. (By the way, this is largely what the book of James is about in the NT where Job is also referenced.)
The text is quite clear in chapter 2. God explicitly acknowledges the ordeals that befell Job were "without cause". So, yes, God allowed Job to suffer in ways he did not deserve. There is no getting around this blatant fact. It's quite clear that some refuse to accept the terms of the story and insist on inventing new ones and forcefully injecting them into the narrative.
Let me ask you: if someone is unwilling to accept that God let blameless Job suffer without cause, how is someone able to accept that God let His blameless Only Begotten Son suffer when He had not done anything wrong? Job was innocent, and yet he was punished. Jesus was innocent, and yet He was punished.
As for the parable in the Gospel of Luke, I see the parallel that is trying to be drawn there. However, the context is abundantly different. Again, the **reason** Job talks about his character and works are because his friends are raking him over the coals, accusing him of having sinned to incur his suffering. We already know from the beginning this is not true -- and Job is trying to reason with them to prove to them they are wrong. What happens? In the end, God shows up and affirms what Job has said is right and his friends are rebuked by God for being wrong.
The Pharisee in the parable is parading himself in the temple and looking down on others for no good reason. He is not suffering, nor is he being challenged by anyone in any way. If you want to make Job a Pharisee, that's up to you, but as someone else pointed out here **with Scripture verses to support it** Job is repeatedly turning **to** God, asking to be shown his sin, and begging God to forgive him. Um...that is not a Pharisee. Not even close.