Why don't modern heavy bombers have gun turrets?
There are really two reasons. First, fighter tactics have evolved over time, and second, the role of the B-52 has evolved over time.

Fighter tactics

Fighters used to depend (heavily) upon getting fairly close to an enemy, and shooting it down with a machine gun. Over the years, guns have become less and less dominant, and instead fighters tend to use missiles from outside a machine gun's effective range.

Role Change

The B-52 was designed from the beginning to carry nuclear weapons. Nonetheless, it's never been used to actually bomb an enemy with a nuclear weapon.

Early in its life, the B-52 was used to drop conventional bombs on enemies though. During the Vietnam conflict (in particular) B-52s were used to drop thousands of conventional 500 pound bombs on various targets.

The Linebacker II campaign was, perhaps, especially notable. During Linebacker II, 15 B-52s were lost--all of them to surface to air missiles (SAMs) not enemy fighters.

Linebacker II did see some limited success from tail guns as well: two B-52s shot down two MiGs. No B-52 (nor any other aircraft of similar size) has shot down an enemy fighter since.

Now, B-52s act as an aerial platform for launching stand-off weapons. Its normal operation is to fly in low (where it's difficult to detect on radar), and launch from a substantial distance from the target. Since it can be a substantial distance from the target, an enemy would need to defend a much larger perimeter (e.g., a large number of fighters basically blanketing a large area) to stand a decent chance of intercepting it.

Even if we assume an enemy fighter were to intercept the B-52, we get back to the situation with fighter tactics outlined above--they'd be unlikely to get within range of its tail gun anyway.