Peter Singer is the Ira W. DeCamp professor of bioethics at Princeton University. His books include “Animal Liberation,” “Practical Ethics” and “The Life You Can Save.”

You’d have to be a real spoilsport not to feel good about Batkid. If the sight of 20,000 people joining in last month to help the Make-A-Wish Foundation and the city of San Francisco fulfill the superhero fantasies of a 5-year-old — and not just any 5-year-old, but one who has been battling a life-threatening disease — doesn’t warm your heart, you must be numb to basic human emotions.

Yet we can still ask if these emotions are the best guide to what we ought to do. According to Make-A-Wish, the average cost of realizing the wish of a child with a life-threatening illness is $7,500. That sum, if donated to the Against Malaria Foundation and used to provide bed nets to families in malaria-prone regions, could save the lives of at least two or three children (and that’s a conservative estimate). If donated to the Fistula Foundation, it could pay for surgeries for approximately 17 young mothers who, without that assistance, will be unable to prevent their bodily wastes from leaking through their vaginas and hence are likely to be outcasts for the rest of their lives. If donated to the Seva Foundation to treat trachoma and other common causes of blindness in developing countries, it could protect 100 children from losing their sight as they grow older.

It’s obvious, isn’t it, that saving a child’s life is better than fulfilling a child’s wish to be Batkid? If Miles’s parents had been offered that choice — Batkid for a day or a cure for their son’s leukemia — they surely would have chosen the cure.

Why then do so many people give to Make-A-Wish, when there are more practical ways of using their charitable dollars? The answer lies, at least in part, in those above-mentioned emotions, which, as psychological research shows, make the plight of a single identifiable individual much more salient to us than that of a large number of people we cannot identify.

In one study, people who had earned money for participating in an experiment were given the opportunity to donate some of it to Save the Children, an organization that helps poor children. One group was told things like: “Food shortages in Malawi are affecting more than three million children.” A second group was shown a photo of a 7-year-old African girl, told that her name was Rokia and urged that “her life will be changed for the better as a result of your financial gift.” The second group gave significantly more. It seems that seeing a photo of Rokia triggered an emotional desire to help, whereas learning facts about millions of people in need did not.

Similarly, the unknown and unknowable children who will be infected with malaria without bed nets just don’t grab our emotions like the kid with leukemia we can watch on TV. That is a flaw in our emotional make-up, one that developed over millions of years when we could help only people we could see in front of us. It is not justification for ignoring the needs of distant strangers.

Some people object that it’s harder to track what happens to money sent far away. That was a concern expressed by callers when I was a guest on NPR’s “On Point ” this month. Edna, clearly a generous person, told us that she volunteers one day a week at a hospital and gives to several local charities. Asked about my argument that donations go furthest when we give to impoverished people in developing countries, she said that she would do that “if I truly believed that the residents who needed that money received it, but no one’s ever convinced me of that, so I give where I can see the results.” Fortunately, she was followed by Meg, a family-practice doctor who talked about her experiences in Haiti working with kids living on less than $2 a day. Meg pointed out that most of these children had never seen a doctor, except when they got their government vaccinations, and that $1,200 was enough to provide them with regular visits by a Haitian health-care worker for a year.

We don’t have to take the word of charitable organizations that the money we give does benefit people in other countries. Technology has made it not only easier to give but easier to give effectively. Web sites such as GiveWell or my own The Life You Can Save offer independent evaluations and can direct people to organizations that do not hand over money to corrupt governments but see that it gets to those who need it.

Some Americans may believe that they already do enough, through their taxes, to help poor people abroad. Polls consistently find that Americans think we spend too much on foreign aid — but when asked how much should be spent, they suggest a figure that is many times more than we actually give. In the Kaiser Family Foundation’s “2013 Survey of Americans on the U.S. Role in Global Health ,” the median answer to the question “What percentage of the federal budget is spent on foreign aid?” was 28 percent. That result is broadly in line with a 1997 poll carried out by Kaiser, in conjunction with Harvard University and The Washington Post. In that poll, the median answer was 20 percent. The correct answer, both then and now, is approximately 1 percent.

Americans commonly think that the United States is a particularly generous nation, but when it comes to official foreign aid, the United States gives much less, as a percentage of its income, than other wealthy countries. According to 2012 figures from the Organization for Economic Co-operation and Development, Sweden and Luxembourg gave five times as much, while Denmark gave four times as much, and Belgium and Ireland gave more than twice as much. Charitable donations by individuals and foundations do not come anywhere near making up for this shortfall.

Perhaps if Americans knew how stingy we are when it comes to helping the world’s poorest people, and were aware of opportunities to do good, we would do more. In an admittedly unscientific test of this belief, my Life You Can Save organization has been offering cash to surprised strangers on street corners from Wall Street to Santa Monica and then telling them that they have a choice: keep it for themselves or donate it to the Against Malaria Foundation. Almost all of them chose to give it away — and some even added their own money to what they had just been given. Altogether, we have given away $2,500 — and the Against Malaria Foundation has received back $2,421.

People who get money as a gift are likely to be more willing to give it away than those who do not receive this unexpected bounty. Nevertheless, the “giving experiment” shows not only that many Americans would like to help the global poor but also that they are genuinely happy to do so. All they need is the knowledge to be able to do so effectively.

Read more from Outlook, friend us on Facebook, and follow us on Twitter.