A lawyer knows the law and knows when a contract is being unlawful; an agent if he's not also a lawyer won't know that.
Good literary agents are well-versed in contract law. They have to be: it's a major part of their job.
Why give an agent 15% for something that I possibly could do at least as good, with the difference I know for sure I'm 100% fully after my own interest.
If you really could do the job that a literary agent does for her author-clients then you're right: there's no point in having one. But you don't seem to realise all a good agent will do for her clients: it goes far beyond the reach of checking a single contract. Agents ensure contracts are adhered to; they collect royalties on time, and check that the correct amounts are paid; and they find and negotiate new deals on all subsidiary rights, which are worth a lot of money. Could you find yourself a Polish publisher, a Czec one, a Spanish, German, French, Australian, Brazillian, UK, US, Portugese, Irish, Icelandic, and Latvian publisher, negotiate with them in their own languages, and oversee all those contracts whilst selling magazine serialisations, large print rights and audio rights? Because so far, that's what the agent of a good friend of mine has done for her.
Lawyers won't go out and find you deals. Agents will. And good agents are qualified to negotiate those deals and check the contracts for you, too.
By the way, a lawyer would negotiate a contract for you if you pay him to do that. A literary lawyer will know the ins and outs of publishing contracts and what is allowable by law, and they are efficient in law speak.
So will a good agent, while doing a whole lot more besides, and without charging you anything upfront for doing it all.
Agent Drama: Agents not returning calls. Agents wanting to receive the whole royalty amount instead of publisher splitting the pay. Agent not paying in time. Muddy administration. Agents not wanting to shop for a book. Agents demanding rewrites. Agents thinking about them firsts. Agents thinking you are their employee instead of the other way around. Agents thinking they know best how your story should be written (Are they the writer?) And more...
These kinds of things you don't risk having with a lawyer, the lawyer does his thing, you pay him, and bye, bye.
You sound not only ill-informed about how agents work, but bitter about them too. How many agents have you worked with? How long have you worked with them? Have you ever had an agent? Your idea of what goes on in the agenting process doesn't correspond with my direct experience of it, I'm afraid.