Why does John faint at the end of "The Yellow Wallpaper?"
The narrator's husband (a doctor), John, has spent the majority of the story diminishing and even undermining the validity of the narrator's mental condition as a product of her imagination and weakness. She tells us, "John laughs at me, of course, but one expects that in marriage." A wife expects her husband to laugh at her?! She is not a child being silly (although he does refer to her once as "little girl"); she is a grown woman experiencing a very real mental illness, not, as John tells all their friends and relatives, "a slight hysterical tendency." We now understand that the narrator is likely suffering from postpartum depression, a condition that affects many women after the birth of a child. It is not "slight," and it is not some little trifling illness that women imagine because they are hoping for a rest. In fact, the narrator hates the rest that her husband forces her to take. However, John tells her that "no one but [her]self can help [her] out of [her nervous weakness], and that [she] must use [her] will and self-control and not let any silly fancies run away with [her]." In other words, her husband believes that the narrator's illness is the result of her overactive imagination, her "silly fancies," and a weakness resulting from her lack of "self-control."
However, in the end, it is he who faints. It is he who is too weak to face the truth of her condition and too weak to bear himself up under the weight of what his "treatment" has done to her. The end of the story seems to point to the idea that it is not women who are mentally weak, though they might be (on average) the physically weaker sex; rather, it is men who are mentally weak for failing to realize that there is more to women's medicine than treating generic "hysteria" with rest, isolation, and imprisonment. By having John faint, Gilman turns the tables on men like the narrator's husband, brother, and even Weir Mitchell, the doctor who John threatens the narrator with. The narrator has found a way to feel empowered, though it required a complete dissociation with her identity. She now believes herself to be free because she is not trapped behind the wallpaper, but her husband cannot handle that truth she has created in her mind: he is the weak one.
John, the narrator's husband, is a product of his time; he has little understanding of his wife's mental state and how his actions are affecting it. At the end of the story, when she has essentially gone insane, he opens the door to her room and finds her "creeping" around the perimeter, where she has torn the yellow wallpaper away.
"For God's sake, what are you doing!"
I kept on creeping just the same, but I looked at him over my shoulder.
"I've got out at last," said I, "in spite of you and Jane. And I've pulled off most of the paper, so you can't put me back!"
Now why should that man have fainted? But he did, and right across my path by the wall, so that I had to creep over him every time!
(Gilman, "The Yellow Wallpaper," library.csi.cuny.edu)
Naturally, John has no idea that the narrator believes a woman to be trapped behind the designs of the wallpaper, or that she has now placed herself into that role. His complete failure to understand her feelings, coupled with what appears to be a complete mental breakdown on her part, is too much for him to handle, and he faints. In this way, he shows that he cannot understand her emotional state, and he becomes a physical obstacle for her to "creep" over instead of a mental or emotional obstacle.
Here is a video summarizing the story: