On the outset it appears as though all the firemen do is burn books, which are illegal in the world of Fahrenheit 451, but that's not their real purpose. Captain Beatty says, when explaining how and why the occupation of firemen changed, that "They were given the new job, as custodians of our peace of mind, the focus of our understandable and rightful dread of being inferior..."
In this fictional world nearly every single house in the country has been made fireproof. This eliminated the need for firemen to put out fires. However, it was decided that they were needed for a different task. Their job is to burn one specific type of contraband.
Books are described very clearly in this novel as being inflammatory all on their own. Books divide people and emphasize different opinions and attitudes. According to Captain Beatty, "The bigger your market, Montag, the less you handle controversy..." Beatty claims that people don't want long complicated novels or different opinions from their neighbors. He says that, in the end, people stopped reading books on their own. They stopped caring about what philosophers and poets had to say because it was too difficult and not nearly as entertaining as their TV "families."
Even so, on the surface, starting raging fires on suburban streets (even fireproofed ones) seems over-the-top and unnecessary. But the firemen aren't just there to help people live in peace and ignorance. It is also their job to provide entertainment and a spectacle. A bunch of men in fireproof suits burning evil books is much more exciting than if they quietly took them back to the station and disposed of them there. As long as the public remains amused, then nothing else matters. In short, the firemen burn books because that's what most of the public wants.
One of the great ironies of this novel is the firemen. In our world, firemen fight fires. In "Fahrenheit 451," the firemen burn books. They do this to fight ideas and to keep their society safe from disruptive influences.
In the society of the Fahrenheit 451 the firemen go to people's houses and burn the books which are illegal. They burn them because they don't want people to socialize because they might ask questions.
The firemen burn books because they do not want the people to gain extra knowledge, which might jeopardize the city.