I cannot agree that Job's religious observance was perfunctory as some answers above suggest. A simple reading of the book of Job indicates otherwise. In fact, God speaks highly of Job to Satan when he says
Hast thou considered my servant Job, that there is none like him in the earth, a perfect and an upright man, one that feareth God, and escheweth evil?
Interestingly, Job's friends who come to comfort him insist that he has done something wrong, or none of this would ever have happened. Job maintains his innocence, and at one point lashes out at them saying
Miserable comforters are you all.
In point of fact, God did NOT "punish" Job; rather he allowed bad things to happen to him to demonstrate to Satan Job's faith in God. The name "Satan" means "the accuser," and in the story, Satan suggests that Job only is faithful because of all his good fortune, but if he loses everything he would curse God. In fact, Job did not, in fact the book states
In all this Job sinned not, nor charged God foolishly
So it is wholly incorrect to say that God "punished Job--he did not. The story is to indicate that humans cannot always understand why things happen, but bad things do not mean a loss of God's love and care. An excellent commentary on Job may be found in Rabbi Rueben Kirshner's When Bad Things Happen to Good People. And speaking of reading, it would be a "good thing" if those who comment on the Book of Job read it first.