A young man, seeking to impress a young woman, decides to volunteer one Sunday at a homeless shelter where the young woman volunteers. On the same day, a young man, seeking to do something productive and meaningful on his day off, decides to volunteer at the same homeless shelter. They both help dozens of people in need of food and a warm place to rest, and bring a slight bit of comfort and joy to the lives of the downtrodden.

Is one of these two men acting more ethically than the other? A new study in the journal Psychological Science suggests that most people would probably say yes, the second man is acting more ethically than the first.

“We were interested in how people evaluate these pro-social efforts in situations where the person stands to benefit personally,” said lead author George Newman, assistant professor of organizational behavior at the Yale School of Management in New Haven, Conn. “What we found through a number of different experiments is that people seem to regard those actions pretty negatively, and in fact view them worse than if someone is just self-interested and not trying to do any good at all.”

In one of the four experiments, 169 participants were asked to rate the morality of a man’s actions on a scale of one to nine, with nine being the most moral. One group of participants were told that the man volunteered at his crush’s place of employment – a homeless shelter – and gave him an average morality rate of 4.75. That was lower than the 5.62 average another group of participants rated the man for volunteering at a coffee shop to get close to his love interest.

That people would judge volunteering at a coffee shop as more moral than volunteering at a homeless shelter for outside reasons strikes me as, well, crazy. But that’s what happened when participants were presented the options separately. Look what happened when participants were presented these options together:

A third group exposed to both scenarios reported an average morality rating of 6.33 in the homeless shelter story and 4.9 for the coffee shop version. Newman suggested that when confronted with both scenarios, those participants recognized that performing a charitable act was better than not performing one.

Which raises the question: does it truly matter why people perform good acts? Well, that depends on the type of ethical framework to which you subscribe.

Consider this statement by Brian Broccolo, volunteer coordinator at Chicago nonprofit Horizons for Youth:

“As long as they are giving their time and energy and as long as they care about the growth of their students, I think their own personal motivation should be a secondary thought.”

Broccolo’s statement expresses, in part, the utilitarian or consequentialist view, which places moral importance on the finality of acts, not the motives or causes of those performing the acts. Within this framework, why people perform good acts — such as volunteering at a homeless shelter — matters little, if at all, compared to whether people perform good acts, whatever their reasons may be.

However, there is a competing ethical framework not focused on consequences, but on the character of the person involved: virtue ethics. In comparison to the utilitarian or consequentialist, the virtue ethicist would say it’s fair, if not necessary, to judge a person’s motives. To the virtue ethicist, morality is not so much about “what constitutes a good act?” but “what constitutes a good person?” A good person, it is thought, will perform good acts. Within this framework, the second man almost certainly acted more ethically than the first.

Is either one of these frameworks “correct”? It’s hard to say. They both have limitations.

Regarding virtue ethics, we are complex creatures with many different, sometimes competing, desires and passions. Often it is impossible to know exactly why we perform an act. Many people who claim they are doing good for the sake of it are actually doing good for some other gain. Perhaps it simply feels good to do good, or to be seen doing good. Or perhaps they want to pad their resume with volunteer experience. Who knows. The point is, our search for the completely pure ethical creature, who always does good simply for the sake of it, will never end. So, even if a person’s motives are questionable, is it not morally better to have that person helping the homeless rather than helping to serve $4 cups of coffee at Starbucks?

In the same way, the consequences of our actions are often out of line with our motives. We might seek to do good, but the world gets in the way, and things do not turn out as planned. Should we be thought less of for this sort of thing? Obviously some ends are foreseeable, but not all. Again, the point is, we cannot view consequences separate from motives.

Which leaves us in a bind. Fortunately I think there is a way out: work our best to ensure our acts are not done for simple personal gain, but for fair gains in flourishing for all persons — including even ourselves — while at the same time value contributions made by people who might be acting on motives we deem less ethical than ours. This might strike you as almost too pragmatic, but what other choice is there?

I don’t think any of us want homeless shelters to stop volunteers at the entrance and grill them on their motives. But we should at least reflect on — if not center our ethical thinking on — the moral decency of our motives rather than their consequences.