I assume that you are asking because your supervisor has suggested that this person be a co-author on your paper.
This is a question with no straightforward answer. Practices differ between fields; in some (particularly health-related), it is common to include people who provided materials or techniques, but contributed neither work nor writing. In other fields, this would be frowned upon. Different supervisors also have their own personal criteria for inviting people to be co-authors.
What does happen in many fields is a kind of quid pro quo, where you invite someone to be on a paper in the expectation that they will later invite you. Or, you feel an obligation to invite someone who has invited you in the past. This is more than just trading off authorship – it’s a way of sharing ideas with other people who you don’t otherwise have an opportunity to interact with. Sometimes, these things lead to nothing very interesting, but other times, they can be the beginning of a very fruitful collaboration. Sometimes, they come out of meetings at conferences, sometimes from the peer review process, sometimes from sharing resources or personnel. The point is, when you’ve been doing research for a long time, the phrases “We should do a paper together sometime” or “Do you want to be on this paper I’m writing now?” come out of your mouth pretty easily. It can be a great source of fresh ideas.
All of this to say: your supervisor has been in this game a long time. He’s used to inviting people to be on his papers. And unless you have a very unusual relationship with your supervisor, he is the one driving your publications at this point. You may be doing all the work, but the funding is likely his, and his name will lend you credibility. So, he will probably feel free to add people to the author list as he wishes.
What you might also not appreciate at this point is that having an extra name or two on the author list will not harm your own standing in the least. Your name is first, and more importantly, this is research coming out of your own project. This is your paper, and no one will fail to recognize that. The most important names on a paper are the first (usually the student) and the last (usually the supervisor). No one cares what comes in between. Even outside of medicine, it is assumed that the contributions of the people in the middle are minimal.
On the other hand, there is undeniably a benefit to the undergrad who ends up being second author on your paper. That is an excellent start to a career in research, and it will look great on his resume. This situation is basically full of win, and no one loses anything. Now, is it fair that no one asked you to be an author on the paper you contributed lab or fieldwork to in your undergrad? Perhaps not. But there is nothing you can do to change that, and it isn’t your undergrad’s fault that you weren’t given this opportunity. As I said, different supervisors have different views on when to invite someone to be a co-author. When it’s your turn, you will make your own completely arbitrary set of rules for your own students.
TLDR:
There is no standard procedure for when to add a contributor (or non-contributor) as an author. There’s no such thing as “not deserving” your place on the author list. There’s no minimal requirement for contribution.
Adding a person to the author list is not an ethical dilemma unless the person committed acts of bad science. You may be in an ethical dilemma if you challenge the authorship without any grounds to do so, because your supervisor has made a commitment to this person, which has nothing to do with you.
If it is not the case that your supervisor wants this person on your paper, and you are trying to decide for yourself whether you should ask him, my advice would be to ask your supervisor.