Or, why good storytelling requires good representation:
When the story doesn't contain the "why," the audience looks to the author.
Let me back up.
Writers are often advised to "write what you know." That's good advice, because you can't write believably about what you don't know. However, authors who took this advice to a logical extreme and wrote only about people just like themselves would suffer for it. They wouldn't tell very interesting stories-- or at least, they would have only one interesting story to tell, and it would effectively be a memoir.
Rather, fiction writers write what they know by research. If they want to write a story about a marine biologist, they would research marine biology. They would research what working as a scientist in that field is like, what kind of person goes into that field, what kind of education and training it requires, and so on.
Because even though it's fiction, believability is key. Fiction writers create worlds that are not identical to this one for the entertainment of the reader, but those worlds contain things that exist in our own world-- like people. If the people in the story don't act like people do in the world world, and no reason is given for this, the audience is confused. The story falls flat. It's bad storytelling.
So this is a kind of constraint on the author. When writing fiction it's literally true that an author can write any story he or she wants-- nobody is going to come in and hold a gun to his/her head and demand that he/she not write the story. However though the author is entitled to write whatever story he/she chooses, he/she is not entitled to the audience's reaction. The audience is not required to think highly of the story. The audience is not required to think highly of the author.
As an example, imagine an author who writes a book whose story involves the sole white occupant of a town being lynched by the rest of the town's population, which is black. If a believable explanation for this plot line can't be found in the story, the audience is going to guess that either the story is satire, or the author has some serious issues with black people. Their likelihood to understand the story as satire is a blend of their own knowledge and the author's adeptness at storytelling. Bad satire happens when the audience can't be expected to have the knowledge that will tip them off to its satirical nature, or when the author doesn't wink hard enough in the writing of the story to make it clear. Or both, of course. When the audience doesn't detect satire (it doesn't provide the "why,") then they quite reasonably look to the author's own beliefs for the explanation.
Good storytelling involves researching the elements in your story if you don't know very much about them. Bad storytelling involves misrepresenting those elements or leaving them out altogether in a way that isn't believable. An author who wants to tell a story about a world congress, in which multiple leaders from every country gather together to exchange ideas, isn't practicing very good storytelling if his/her story depicts this congress as containing only white men, unless a reason is given for this. Was there some mass extinction of women and people of color? Did the white men totally take over the world, including the government of every country on the planet, and if so....how did that happen? The extraordinary event requires an extraordinary explanation. In fact in this case, it would be such an extraordinary explanation than it might as well be the story. If it isn't, but is treated as a totally unremarkable circumstance by the characters in the story, the audience would rightly look to the author with a "WTF?" expression on its collective face.
These examples are extreme, but that's on purpose-- to illustrate how the content of a story can lead the audience to negative conclusions about the beliefs and prejudices of its authors. The less cut and dry it is, obviously the less justified the audience would be in reaching these conclusions. But the audience is not wrong to see an unbelievable depiction of people in a story and assume that the explanation lies in the author's motives, and they're going to do it regardless.
The first people to notice when certain groups of people are misrepresented in or left out of a story for no discernable reason are, quite naturally, people in those groups. But they're not the only people who do notice or should notice. It might take a white guy a little longer to look at the "world congress" and think "Hey, wait a minute....why is it only people like me?" But he wouldn't be very bright if he never got there. Not very bright, or else like the author in either prejudice or ignorance (or both).
People want to hear stories told about people like them-- yes, of course. However, people also want to hear good, believable stories. If a story makes you stop and wonder why the author portrayed characters in a way that rings false, or leaves them out altogether when it seems like they should be there, that's bad storytelling unless making you wonder these things is the author's point-- and even then, if you can't tell whether it is or not, that's a problem.
That's why diversity matters in storytelling-- not just because people want to hear/see it, and they do, but because it makes the story better. Because the story contains the "why."