As it turns out, the above answerer posted while I was typing. I completely agree with her answer...
The firemen are there to keep people happy by making sure they don't have to think too much.
Beatty tells Montag this when he gives him a long speech at Montag's house after they have burned the old woman along with her books.
Beatty tells Montag that books made too many people unhappy by forcing them to think, or by telling them things they didn't want to hear. THat's why Beatty tells Montag that
We stand against the small tide of those who want to make everyone unhappy with conflicting theory and thought.
The firemen, along with things like the parlour walls, keep people from having to think because thinking would make them unhappy.
According to Beatty, the firemen do much more than just burn down houses and enforce censorship. He says that they are the enforcers of happiness and peace in their society. They are the ones that keep rebels and independent thinkers from causing too much havoc and chaos. They are the ones that make sure that everyone has enough to do to stay busy, and not enough material to prompt thinking and rebellion. He states and he leaves Montag's house after his "history lesson":
"we're the happiness boys, the Dixie Duo, you and I and the others. We stand against the small tide of those who want to make everyone unhappy with conflicting theory and thought....I don't think you realize how important you are, we are, to our happy world as it stands now."
Beatty justifies the rather horrible things that they do to people and thier lives and homes by assuring himself that he is maintaining happiness and peace for the entire society. After all, if anyone rebels, they are destroyed, and the source of rebellion goes away. So everyone complies and peace is established. I hope that those thoughts helped; good luck!