Virtue signaling is the conspicuous display of moral character. When we use the word in a pejorative way, we mean something like the conspicuous display of moral character for the purpose of self-promotion. Often virtue signalers are engaging in a grandstanding. As Warmke says, "Grandstanders are moral show boaters who use public discourse as a vanity project. They aren't really concerned about helping people or contributing to a conversation."
We have strong reasons to think that most but not all virtue signaling is self-interested and not virtuous. But when, if ever, is virtue signaling virtuous?
Let's use something like Rosalind Hursthouse's basic formula here: A virtuous person does the right thing for the right reason and feels the right way about it. A virtuous action is a right action done for the right reasons and accompanied by the right kinds of feelings.
Thus, a virtue signal might possibly be right or good but not virtuous. If I do the right thing for the wrong reason, I am not acting virtuously. For instance, if Bob saves the drowning child's life only because Bob wants fame and status, Bob does the right thing, but his actions aren't virtuous. Similarly, if the primary reason I engage in virtue signaling is that I want to promote my own status, my actions aren't virtuous, even if it turns out that such virtue signaling is the right thing to do in this situation or even if it promotes good outcomes. Virtuous action must be sufficiently, if not solely, motivated by moral reasons. So, below, assume that in the cases discussed, the virtue signaler is sufficiently motivated by moral reasons and has the right kinds of affective attitudes.
1. Lots of people--especially those who engage in frequent virtue signaling--like to claim virtue signaling is virtuous when it pressures and induces others to develop more virtue and act more virtuously. Suppose one prays in public in order to induce others to be more pious. (Assume they're worshipping the correct god.) One engages in conspicuous donations to charity in order to induce others to give more to charity. (Assume they're giving to an effective charity.) One protests conspicuously in order to bring more people to the cause. (Assume it's a good cause.)
It seems likely that conspicuous virtue displays sometimes do induce others to follow suit. They also often induce them to rebel against the displays. They often engender cynicism. I don't know if there are good empirics on this showing when virtue signals induce others to behave better or when they have bad effects.
Anecdotally, it seems like costly signals are more likely to induce good responses, while cheap signals are more likely to induce cynicism. When the Yetter-Chappells and Neil Sinhababu talk about how they've donated a large portion of their income to effective charities, this makes me want to give more. When certain other philosophers write blog posts loudly proclaiming their virtue but which cost them nothing, this makes me more cynical. But that's all anecdotal.
2. Another reason a virtuous person might virtue signal is to get what they deserve.
Consider: People deserve to have a reputation (at least among those who know them) that matches their degree of virtue. It's unfair and wrong to think your spouse is a cheater if he isn't.
A virtuous person might recognize that people think wrongly of a third party, and then work to correct their misperception. Here, the virtuous person might be motivated to ensure that the third party gets what she deserves. For instance, if Terry thinks Dave is an asshole, but Dave is a good guy, I might try to correct Terry's mistake because Dave deserves that Terry think highly of him.
If a virtuous person might want to ensure others get what they deserve, they might also want to ensure that they themselves get what they deserve. If Bob could virtuously work to ensure Dave gets the reputation Dave deserves, why can't Bob also virtuously work to ensure Bob gets the reputation he himself deserves? Of course, people often will lie to themselves and tell themselves this is all they're doing, but here we're asking whether a genuinely virtuous person might do this kind of thing.
So, it seems plausible that a genuinely virtuous person might self-promote and engage in virtue signaling if doing so is useful to ensure that people give that person what she deserves.