Later on, when he felt that no one was looking, he picked up the dirt from the floor and placed it in his sleeve. Thereafter, when he exited the musjid, he removed the dirt from his sleeve and threw it on the ground.
Through observing the conduct of Imaam Bukhaari (rahimahullah), I realized that he wished to keep the musjid clean from dirt, just as the person wished to keep his beard clean from dirt.
Note: This incident reveals the great respect that Imaam Bukhaari (rahimahullah) had for the house of Allah Ta‘ala, as well as the high level of ikhlaas and sincerity which he was blessed with, that he did not want to reveal the good deeds he did before people.
(Hadyus Saari pg. 481)