Companies contribute billions annually to the public good, but most of them aren’t reaping the full value of their largesse.