The reason for the narrator’s confinement is her gender. Although explicit references to either gender in the text are rare, there is certainly a gendered subtext, especially given what we know about the period in which Gilman was writing (late 1800s). The narrator’s confinement and repression are strictly based on her gender. The women we see in the story are meant to find fulfillment in the home, while the men hold positions as high-ranking physicians. The narrator’s lack of a name also reinforces the notion that she is speaking as the voice of women collectively, rather than as an individual.
Although women today are no longer prescribed "rest cures," the broader concept of women being imprisoned by societal mores remains a highly relevant concept.
"The Yellow Wallpaper" critiques only the life of wealthy white women and excludes the plight of low-income and women of color.