This is just a short sketch of something that requires much fuller treatment. On top of that, this is a statement about just one aspect of this problem, and not an attempt to minimize the other problems that might be in play.
Pastors are usually husbands as well, and this means that when a pastor has a wandering eye, he is insulting his wife in exactly the same way that other husbands are insulting their wives through the same behavior. Every Christian husband is the head of his wife in a way analagous to the way that Christ is the head of the church (1 Cor. 11:3; Eph. 5:23). This means that every husband is constantly speaking about Jesus, whether he wants to be or not. He does not have the option of being silent about Jesus. His behavior is a statement about his theology of headship. He is saying that "this is an appropriate way for a head to act." And because Christ is the ultimate Head, the behavior of lesser heads are statements about the nature of His headship. Just as abusive fathers are lying statements about God the Father, so unfaithful heads are a lying statement about the fidelity of Christ to His bride.
So of course a pastor needs to be faithful for that reason alone. He took his marriage vows independently of his ordination vows. But is there any additional level to this? I believe so.
When worship is being conducted in a fully biblical way, the minister and the congregation enact (in a liturgical way) a dialogue between Christ and His bride. The minister is standing in for Christ as His herald, His ambassador, His representative. This means that a pastor who has a problem with porn is lying about Christ in two ways. The first is in the way that every husband would be lying, because every husband represents Christ in some way. But the second way is at a much higher level -- the minister is set apart in another unique way, and he has been set apart in this way in order to represent Christ in a more heightened way than all husbands do.
Working from the other direction, what will a secret porn problem do to the preaching and teaching? The minister who has a radical inconsistency between his enactment of Christ in his private life and his enactment of Christ in his official capacity is aware (as others are not) of the inconsistency. But people are not built to live with such inconsistencies. We don't like walking with rocks in our shoes. So the two ways to remove the inconsistency would be 1. to repent of the porn use and deal with it appropriately or, 2. begin to teach and preach in ways that create more and more wiggle room for everybody.
But when men preach wiggle room they often find that other men will frequently like the look of that wiggle room. If a man comes preaching wine and beer, he would be just the spokesman for this people! (Micah 2:11). This creates a cycle -- the minister is being pushed to compromise from within, and once he begins preaching more tolerant (and therefore more tolerable) sermons, he begins to be pulled. He has presented handles to those who would pull him. And so the lie about Jesus that he has allowed to take root in his heart is a lie that works its way into his manuscript. And from there into other hearts.