The evidence for this is that the Prophet ﷺ said, in the report narrated by Imam Ahmad: “Whoever speaks on Friday while the imam is delivering the sermon is like a donkey carrying loads of books”—this comparison is intended as a condemnation and deterrent—“and the one who says to him, ‘Be quiet,’ has no Friday prayer.” (1) Although the one who tells him, “Be quiet,” is forbidding what is wrong, he nevertheless engages in idle speech; and whoever engages in idle speech has no Friday prayer.
The meaning of “has no Friday prayer” is that he does not attain the reward of the Friday prayer; it does not mean that his Friday prayer is invalid. The reward of the Friday prayer is greater than that of the other prayers.
Likewise, it is narrated in the two Sahih collections: “If you say to your companion, ‘Be quiet,’ on Friday while the imam is delivering the sermon, then you have engaged in idle speech.” (2)
His statement, “except for him,” means: except for the imam.
His statement, “or for someone who speaks to him,” means: someone who speaks to the imam, or someone to whom the imam speaks.
His statement, “for a beneficial purpose,” qualifies both cases: the person who speaks to the imam and the person to whom the imam speaks. The imam is not permitted to speak without a beneficial purpose; rather, it must be for a purpose connected to the prayer or to some other matter in which it is appropriate to speak. If the imam speaks without a beneficial purpose, it is not permissible.
If there is a need, then it is permissible all the more so. An example of need is when the listeners do not understand the meaning of a phrase in the sermon and one of them asks about it. Another example is when the preacher makes a meaning-altering mistake in a verse, such as omitting a phrase from it or making a grammatical error that changes its meaning.