Every writer get rejected. You either continue to submit queries or you quit. The third choice is to go Indie and self publish either in print or in digital e-books.
In a recent blog from Anne B. Allen and Ruth Harris some reasons I had not thought of were given. Agents want to make money, but first and foremost I think they want to make publishers happy by getting them the type of books they want, whether you story is well written or not.
But anyway here is the link to her blog. It is worth the read. The ten reasons come from an editor by the way. Reasons 4, 5, 7 and 9 are my favorites. You just never know.