The materialist science output is specifically for materialist pops.
So if a unit of Balorians (my races people for my first game) lost their fanatic materialism and downgraded to normal materialism they'd produce half as much bonus science as before, even if the majority of my empire is still fanatic.
On the other hand, if they acquired Militaristic 1 (standard) they'd gain 5% bonus happiness upon war declaration due to militancy's war happiness bonus, and my other pops would not.
In this way pacifists can be mad when you declare war, collectivists can be more tolerant of slavery (their own and others) and individualists can have even further ethos drift as they balkanize and fragment.
However the bonus from your government is global to all pops, so if you had individualists emerge in your divine mandate (which has a 50% slavery tolerance bonus) they'd still have the tolerance bonus which would cancel out the penalty (until they became fanatic individualists, but they'd still have only half the penalty as a result of your government)
Another government example (also spiritualist) is theocracies, which have -10% ethos drift this applies globally, and so can cancel out the effects of individualists ethos drift.
Alternatively say your a plutocracy, all population units will have the bonus energy/materials income, but individualists will stack this with their own ethos bonus for a greater bonus (additive, not multiplicative I believe)
Edit: Why did someone respectfully disagree? if you're going to disagree with me (on facts, rather than opinions) please tell me what I said that was wrong, and correct me rather than silently downvoting me, thank you.