Because it is comming in contact with an enzyme called 
catalase, which is present in blood and skin cells. It bubbles because there are broken cells and blood present.
More specifically, the bubbles are caused by the catalase turning the H2O2 into water(H2O) and oxygen. The oxygen readily attacks .. just about anything organic, and especially anaerobic bacteria, killing it.
Edit: Peroxidase? 
 HowStuffWorks link.
HowStuffWorks link.
It looks like peroxidase and catalase are both catalysts for the reaction. I think catalase is much more efficient, though.
Apparently, potatos contain lots of this enzyme, so it will foam and bubble if you put it on a cut potato, too.
If you have a sponge that you regularly use for washing the dishes, etc.. pour some on that. It will foam and bubble quite violently, and the sponge will get quite warm, assuming it is full of bacteria like they normally are. I clean our sponge at least once a week this way.