The Tur (Rabbenu Ya'aqob Ben Asher, 'a"h), writes that he heard his father, the Rosh (Rabbenu Asher Ben Yehiel, 'a"h), say "Barukh Hu Ubarukh Shemo" every time that he heard someone recite a Berakha (blessing). He explains that this is based on what Moshe Rabbenu said (Debarim 32:3), כי שם ה' אקרא הבו גודל לא-ל-הינו "Since I call out the L-rd's Name, give greatness to our G-d".
Not only does it say that whenever he mentions G-d's Name, we should ascribe greatness to Him, but we also say זכר צדיק לברכה (Zekher Saddiq Librakha - may the memory of the righteous person be a blessing). If we have to bless a righteous person when we mention him, how much more so Saddiqo Shel 'Olam (the Righteous One of the worlds - G-d)?
The Kaf Hahaiim writes that there are also deep mystical כוונות (intents). The Shulhan Arukh writes as well, that to every Beracha one hears, one answers Barukh Hu Ubarukh Shemo at the mention of G-d's Name. This explains the importance Sephardim and many Ashkenazim place on answering Barukh Hu Ubarukh Shemo.
There is a difference of opinion, however, as to whether answering Barukh Hu Ubarukh Shemo is merely a good custom, or whether it is an obligation. In the Sefer Rishon LeSion on the Gemara of Berakhoth as well as in Sefer Maase Rab, it says that it is not an obligation. Others, including Rabbenu the Hida, 'a"h, say that it is, in fact, an obligation. This explains why there are certain communities that are less Maqpid (strict) to answer Barukh Hu Ubarukh Shemo, while others are very meticulous to answer.
(See Shulha 'Arukh, 124:5)
Baruch Hu Uvaruch Sh'mo, Baruch Hu Uvaruch Shemo, Barukh Hu Ubarukh Shemo