The Haloform reaction is the α halogenation of ketones and aldehydes under basic conditions.
Under these conditions, an enolate is formed. The nucleophilic enolate attacks the Br2 to form the brominated ketone.
Its difficult to stop at just one bromide, since the monobrominated product is more acidic than the initial ketone reactant.
For methyl ketones as in this example, all three α protons are replaced with bromines. Once all three α hydrogens have been replaced with Br atoms, the CBr3 becomes a good leaving group. Remember good leaving groups are stable anions and the -:CBr3 anion is rather stable because of the three Br atoms (electronegative and polarizable). The same would occur for reactions with Cl2, and I2.