Satan was complaining bitterly to God: "You made the world so that it was not fair, and you made it so that most people would have to struggle every day, fight against their innate wishes and desires, and deal with all sorts of losses, grief, disasters, and catastrophes. Yet people worship and adore you."
"People fight, get arrested, and cheat each other, and I get blamed, even when it is not my fault. Sure, I'm not perfect, but give me a break. Can't you do something to make them stop blaming me?"
And so God created lawyers.