Why do you think God allowed all the heartache to happen in Job's life. Was it because he put more devotion of family and things before "God Himself"??
See Job 1:6-12 : We see no evidence of that. Satan's accusation said that taking away Job's children and property would cause Job to curse God. But we don't see idolatry in Job's life prompting God to allow Job to be afflicted.