To answer this question, we first need to establish what an allegory is. In a nutshell, an allegorical story is one that can be unpacked to reveal a hidden meaning, moral, or deeper truth. There is no doubt that "The Ones Who Walk Away From Omelas" contains hidden meanings and deeper truths.
At face value, this story is about a town filled with people who get to live an idyllic life of happiness, where nothing goes wrong and everyone lives in a state of perpetual harmony. The price of this happiness, however, is paid by a child of indiscriminate gender, who is permanently locked in a closet. The child lives in a state of squalor, with only corn meal and grease to eat, and never gets to see the light of day.
Allegorically speaking, this story is referring to the privileged people of the world who have obtained their wealth and freedom as a result of the hard work, blood, sweat, and tears of others.
The fact that some people in the world care about the suffering of others while others do not is alluded to by the fact that when the people of the town discover the existence of the child and visit "it," some choose to kick the child, while others take a sympathetic approach and choose to leave Omelas.
This poignant short story makes the point, using allegory, that wealth and freedom come at the expense of the enslavement of others.