Most of us writers want to be published, but more than that, we want validation as a writer. If our book is accepted by an agent and then by a name-brand publisher, we achieve some validation unless the reviewers ring in with a different opinion.
The harsh truth is that agents are confronted by hundreds or thousands of queries a week. They may have a toothache or feel particularly jaded the morning yours arrives, or they might be looking for the latest trendy possibility, a quick sale, a young genius that will have a long life in their stable, or dozens of other reasons that have nothing to do with your book but result in refusal, nonetheless. Agents have been wrong many times—and publishers even more.