Genres serve several functions, but those functions differ depending on your perspective.
Genre helps readers determine the kind of story a novel is and whether it is likely to suit their tastes. For example, a literary story has a very different feel than a traditional fantasy story, which, in turn, has a different feel than a traditional science fiction or a traditional thriller.
Genre helps marketers (publishers, bookstore owners, authors) sell their novels to readers who are likely to enjoy the book. Readers who are looking for a certain kind of story can browse by genre, and may purchase more books when one book they enjoyed is affiliated by genre with other books they have not read.
Genre also helps writers, because each genre has its own set of styles, conventions and
expectations. Writers who understand the genre in which they choose to write can make informed decisions on the styles they use, the conventions they conform to (and the conventions they break), in order to meet readers’ expectations in a satisfying way.
Understanding genre functions help writers make informed choices in their writing and in their career development. Everything—from the stories you tell and how you tell them to how you market your work to agents and publishers, and finally to readers—is influenced by genre. This, of course, does not mean writers must stick to a single genre or that they must follow a traditional story or career path when writing in a particular genre. However, understanding the genre helps make for informed choices.