The reason al-Bukhari repeats a single hadith in one or several places of his Ṣaḥīḥ:
It is well known that al-Bukhari—may Allah have mercy upon him—did not compose his Ṣaḥīḥ merely to string together sound reports. In addition to gathering authentic hadiths, he intended to draw from them the legal rulings they contain. Accordingly, he would extract a ruling from a given hadith, set it as a chapter heading, and then cite the hadith beneath that heading as proof. He would then derive another ruling from the same report, give it a separate heading, and cite the hadith again for that new purpose. The repetition, therefore, is a matter of adducing evidence: whenever he repeats a hadith for evidential purposes, he never leaves the passage without adding a fresh benefit—namely, that he transmits it through a different shaykh from the one he cited previously. This, in turn, demonstrates the multiplicity of transmission routes for that hadith.
For this reason al-Ḥāfiẓ Abū ’l-Faḍl Ibn Ṭāhir al-Maqdisī, as quoted by al-Ḥāfiẓ Ibn Ḥajar in the introduction to Fatḥ al-Bārī, said: “He seldom places a hadith in two different chapters with the same chain and identical wording.” Ibn Ḥajar added that such occurrences are extremely few, and the author of Kashf al-Ẓunūn observed: “Those he repeats with an identical chain and text amount to twenty-three hadiths.”
Al-Bukhari had other objectives for repeating a hadith in various locations, many of which al-Ḥāfiẓ Ibn Ḥajar enumerated in the introduction to Fatḥ al-Bārī.