When you are in the lineup, you are forced to take up a defensive position. DH is one of those positions. That is, by being the DH, somebody else in your starting 9 is not the DH and is instead playing a position on the field.
If we replaced you, the DH, with a guy who was replacement level defensively and we could shift everybody else accordingly and put our worst defender in DH, how much better/worse would the team defense be? Well, it turns out that it's really easy to find solid defenders if that's all we cared about. In fact, it's so easy, there's basically no limit to them. Ah, but we have to get the whole package. The replacement has to hit too. And it turns out, when you look at the population of guys whose total package of production sums up to being just barely good enough on balance to make the majors, they average out to being poor hitters and league average defenders.
But what if you went and found a replacement level guy who was actually a very solid, DH-level hitter? Well, that's a much smaller pool of guys to pick from. And if he's that good a hitter but but still freely available, it's likely because he's entirely useless defensively. To put him in the lineup, you'd either suffer his poor defense at a position where he do the least damage or you play him at DH and be forced to play your other 8 guys at positions, including the guy who is the worst among the 8 who might other get to DH.
So, back to the question. If we go out and get a replacement level guy to replace the DH, what's the impact on the team? Well, know that the total package adds up to replacement level, if he's a decent defender, he's almost certainly a much worse hitter than the average DH. And if he's a DH level hitter, he's almost certainly borderline unplayable on defense. And if neither of those is true, he's not a replacement level player.
So there you go. The DH is a position and, by virtue of filling it, you are impacting the ways in which your team can obtain production. To properly account that, you have to adjust for the lack of value that guy is providing you by not contributing anything on defense.
Is the number they use the right number? That's arguable. I've seen well-reasoned arguments that it should be the same as the worst of the 8 positions (following my logic above) instead of 5 runs worse. But it is definitely not zero; the opportunity cost is real and it shows up in the runs your team can't prevent by better utilizing the other 8 defenders.