The only way to manage the explosion of knowledge in 18th-19th centuries was through specialization. In premodern Europe, the amateur or “gentleman scholar” could be respected. A person of wide learning who studies for the pleasure it, not as a profession, would be much sought after in upper class society, which is the world Hedda Gabbler is accustomed to and wants to return to. When she can’t find it–and other characters’ desires start closing in on her–she shoots herself.
We see in thinkers like John Stuart Mill, who died just six years before the premiere of A Doll’s House, that morality and religion are only loosely coupled. For Mill, and his father, Christianity actually undermined morality.