Helen Alving is about to dedicate an orphanage she has built in the memory of her late husband, Captain Alving. She reveals to Pastor Manders that her marriage was secretly a miserable one, primarily because of her husband's immoral, unfaithful behavior. She has built the orphanage to deplete her husband's wealth so that their son Oswald will not inherit anything from him. Pastor Manders had previously advised her to return to her husband despite his philandering, and she followed his advice in the belief that her love for her husband would eventually reform him. But her husband continued his affairs until his death, and Mrs. Alving stayed with him to protect her son from the taint of scandal, and for fear of being shunned by the community.
During the action of the play, she discovers that her son Oswald (whom she had sent away to avoid his being corrupted by his father) is suffering from syphilis that he inherited from his father.[a] She also discovers that Oswald has fallen in love with her maid Regina Engstrand, which is a serious problem because Regina is revealed to be an illegitimate daughter of Captain Alving, making her Oswald's half-sister.
A sub-plot that concludes before the play's denouement involves a carpenter, Jacob Engstrand, who married Regina's mother when she was already pregnant (though he is unaware, or pretends to be, that Captain Alving was Regina's father) and regards Regina as his own daughter. Having recently completed his work building Mrs. Alving's orphanage, Engstrand announces his ambition to open a hostel for seafarers. He tries to persuade Regina to leave Mrs. Alving and help him run the hostel, but she refuses. The night before the orphanage is due to be opened, Engstrand asks Pastor Manders to hold a prayer-meeting there. Later that night, the orphanage burns down. Earlier, Manders had persuaded Mrs. Alving not to insure the orphanage, as to do so would imply a lack of faith in divine providence. Engstrand says the blaze was caused by Manders' carelessness with a candle and offers to take the blame, which Manders readily accepts. In gratitude Manders offers to support Engstrand's hostel.
When Regina and Oswald's sibling relationship is exposed, Regina departs, leaving Oswald in anguish. He asks his mother to help him die by a morphine overdose to end his suffering from his disease, which could put him into a helpless vegetative state. She agrees, but only if it becomes necessary. The play concludes with Mrs. Alving having to confront the decision of whether or not to euthanize her son in accordance with his wishes.