Another point I believe Gilman is making is that mental illness and depression (particularly post partum depression) were not treated effectively during this time. Anyone who had mental illness was either locked up in a sanitorium or given shock treatments, etc. These people were treated like pariahs of society, which was so unfortunate. Gilman's story brings the unfair treatment of depressed women to light in her story, which helped raise awareness about it.
Gilman is saying that the subservient, silent role women have been forced to play in Victorian society is not just unfair, but very damaging. The protagonist's husband and other male figures, such as doctors, are the only people allowed to make decisions. Moreover, the protagonist relates how women of her era have been conditioned to accept this secondary status when she says, "John laughs at me, of course, but one expects that in a marriage." It doesn't matter what she thinks will help her or what she knows isn't working, John will not listen. He only calls her his "little goose" and dismisses everything she says as the silliness of a woman.
Had he but listened to her, she may not have totally slipped into madness. But because she (and other women) are not respected or thought capable of logical thought, she is doomed.
Gilman herself suffered from depression and was subjected to the same "rest therapy" as her protagonist in this story. In her essay "Why I Wrote 'The Yellow Wallpaper,'" she states that this treatment was not only inadequate or unhelpful, but nearly left her insane, and that leaving the situation (and ultimately her husband and doctor) was the only thing that saved her.
For more information on "The Yellow Wallpaper," Gilman's essay, and Charlotte Perkins Gilman, see the links below.