Why Is Jesus the “Good” Shepherd?

In the parable of the Good Samaritan, Jesus used a person whose race and religion was despised as a metaphor of his own work – in the parable of the Good Shepherd he compared himself to a profession that didn’t have the best reputation. Why?