Dickens contrasts Joe and Magwitch because both are father figures for Pip. Pip does not have a father, and he is mostly raised by his sister and uncle, Joe. Since Magwitch chooses to be Pip’s benefactor, he and Joe play similar roles. Joe is responsible for Pip’s education as a blacksmith, and Magwitch is responsible for his education as a gentleman. Both men are coarse, but kind. Pip is ashamed of both of them at first. He is horrified when Magwitch and not Miss Havisham turns out to be his benefactor.
The contrast between Joe and Magwitch is thematically important because Pip grows up considerably due to the events with Magwitch. He learns to appreciate, and even love, Magwitch. He realizes he has treated both of them badly, and spends the rest of his time trying to make up for it and be a better son to each.