According to Beatty, firemen keep everyone happy because they burn books. And, according to him, books make people sad. This is shown later on as Montag reads the poem "Dover Beach" to Mildred's friends and they end up sobbing from the "hurtful words". Because their society is so dumbed-down, so in denial about their happiness, making them think on any level whatsoever is earth-shattering for them. Montag himself is certainly thrown for a loop once he starts questioning everything.
The reasons that books make people sad, other than stated above, is because they have content that offends the "minorities" in their civilization. Everyone was offended by something in the books, so, burning them makes it so that people don't have to read "offensive" material. For example, Beatty states, "Someone's written a book on tobacco and cancer of the lungs? The cigarette people are weeping? Burn the book." So many people found something offensive that all books should just be burned so that people can be happy; and that is where the firemen come in.