The first time Beatty visits, it is after Montag steals a book from the lady's house that they had burned the night before. He sleeps in that next morning, and Beatty shows up. The reason he gives is that he had guessed Montag was going through a crisis, and that "Every fireman, sooner or later, hits this...they only...need to know the history of our profession." Montag had been asking a lot of questions lately, so Beatty showed up to explain why books had to be burned, and why Montag was performing a public service by doing so. He gives a long lecture that all boils down to the fact that "People want to be happy". He then alludes to the fact that all fireman want to read one at some point; that Montag shouldn't bother because they say "nothing", and if he did happen to read one, to return it in 24 hours.
The subliminal message to Montag is that he had better shape up, get his act together, and get back to work. It's a passive-aggressive way of saying, "I know what you're up to, and you had better stop." Well, Montag doesn't, which prompts Beatty's second visit: to torch the house and arrest Montag.
Beatty visits Montag's house on two occasions.
The first visit operates as a warning to Montag; Beatty seems to know that Montag is having a breakdown, which he claims to recognize due to the number of questions that Montag has been asking and his growing sense of doubt. Beatty takes it upon himself to explain the history of firemen and indicate why books must be burned. Beatty insinuates that he knows Montag is longing to read, and that this activity would be useless because books don't say anything of value.
Unfortunately for Montag's home, Montag doesn't cease his pursuit of knowledge. Thus, when Beatty visits the house for the second time, he does so in order to arrest Montag and burn the house down.