Dr. Stockmann makes a discovery that he thinks will help the town. He presses for changes to be made to the baths, but the town turns on him. Not only have his scientific experiments been a waste of time, and not only will the townspeople suffer, but his freedom of speech and self-respect are being attacked. He then decides that the only reason that the leaders have turned on him is that they are afraid of the people. He, thus, lashes out at the people. He is motivated both by his anger and by true realizations about the corruption of the town.
It can be concluded that An Enemy of the People has two key messages. First, it is a criticism of democracy. Second, it is the story of how one man's bravery and self-respect can survive overwhelming odds.
Ibsen's critique of democracy is twofold. First, he shows the tyranny of the majority. The majority is a tyrant insofar as the leaders of society are afraid to do what is right because they are at the people's mercy. Even though Hovstad wanted to print the doctor's report on the baths, he was afraid to do so because his subscribers would be upset. The mayor cannot propose any changes to the baths because the public might find out that the mayor had made a mistake in the original plans and, thus, oust him. The majority is afraid of risk and, according to the doctor, it is not intelligent enough to do what is right.
While Ibsen illustrates the tyranny of the majority, he also shows how leaders can manipulate the majority. When Aslaksen and the mayor take control of the town meeting, they are manipulating the majority, using the majority to their ends. It could be that Hovstad merely cited his subscribers' possible wrath as an excuse because he himself did not want to print the article. More likely, both he and his subscribers would have been against the doctor. Those who are in power, like Hovstad and the mayor, automatically guess what the majority will want, and they always try to please the majority. While Aslaksen and the mayor manipulated the audience at the town meeting, they influenced them in the only way possible. In other words, it would have been almost impossible for the mayor to convince the crowd that they should support the doctor's comments about the stupidity of the masses. Ibsen's idea is that the majority does not rule directly; instead, the idea and threat of the majority keeps leaders from acting honestly.
The personal story of Dr. Stockmann is secondary. The key thing to remember is that he is extremely idealistic and maybe even a little naive and foolish. His wife, after all, feels compelled to remind him of practicalities.