I witnessed parents telling their kids that, if they didn't get hurt or physically harmed in any way, they have no right or reason to cry. I kind of disagree because one doesn't cry just because of physical pain, and it's kind of debatable of freedom to tell a kid that they have no right or reason to cry because the parent feels they have no reason from their perspective; they are not looking at it from the child's.
There's a difference between an emotion and its expression. Crying in children is a social signal, "I need someone urgently to fix my problem." Parents who tell their children not to cry about something aren't telling them it's not okay to feel that emotion, they are telling them, "This is not something that requires the urgent degree of other people's attention that loud crying demands."
Try not to judge from the short windows of time during a visit. It might be the first time your child has cried in a few days, but it might be the tenth time today for the other parent's child who is being corrected.
I certainly agree that it is wrong to tell a child (or an adult, for that matter) that the only legitimate reason to cry is if they have suffered physical injury.
On the other hand, your brief account above doesn't necessarily tell the whole story. I don't know if you know the whole story. Did you just overhear a snippet of a conversation in passing? Or walk into a friend's house just in time to hear them say this? Or were you with the other family for hours?
On the one hand, if a small child is crying because of some legitimate emotional upset, I'd certainly say that the parents are wrong to tell him he shouldn't. To take an extreme example, if a child is crying because a beloved pet just died, it would be a pretty harsh parent who would tell him to shut up and has no reason to cry.
On the other hand, when my kids were small, there were times when they would cry and scream for the most trivial reasons. (For example, I recall: When my kids were little and I would give them each a card printed on the computer with our home phone number and my work phone and, I forget, some other phone number, for them to keep in case of emergencies. Then one day one of these phone numbers changed so I hand-wrote the new number on the cards. And one of my kids started crying and screaming because he wanted a new printed card and not the hand-written update.) I can readily imagine a hard-pressed parent whose child is screaming over nothing trying to calm the child down, and after some long period when the child just keeps screaming and screaming finally says, "You're not hurt! You have no reason to cry!" A statement about there being no good reason to cry because the child is not physically injured may not be intended to be a complete discussion, rather the parent is contrasting a good reason with the poor or non-existent reason for the child's present crying. Yes, children remember things you say and can go back to something inaccurate or oversimplified that you said years ago, so I suppose a perfect parent would give a more complete statement. But being a parent of a small child is very stressful, and I'd give them some slack.
I agree with the previous answers in that you may not k ow the whole story (based on your short question), but I disagree that it's ever ok to tell a child they have no reason to cry. A child doesn't understand the difference between "this doesn't warrant such an emotional response" and "you're not allowed to cry over this". I always cringe when I hear "You're ok. Stop crying." On the playground when a kid falls or is pushed by another kid or whatever. Kids are like tiny teenagers; they are still learning what emotions are and how identify them, the appropriate way to express them, and, when necessary, how to control them.
I feel a better response crying is acknowledging how you think they feel, validate that feeling, and offer how that feeling can be better expressed. But not tell them the way they expressed it (by crying) was wrong. They're still learning.
For example, my daughter has been crying every time my husband steps out if the room. He will be out for a moment and come right back, by for whatever reason, this upsets her. So I tell her "You must be upset dada left the room and you miss him. That's ok. He's going to be right back! Do you want a hug (or this toy, or read a book, or help with a chore) while we wait?" This usually does the trick. And she cries less every time and redirects her behavior because she has a better outlet. And she knows he always comes back.
As you stated, my adult perspective says there's no reason for her to cry. He just went to take out the trash and he's coming right back. But her perspective is that it made her sad. Who am I to tell her she can't be upset over that? An older child can be told "I'm sorry you're sad. A great way to get through this is to _____". But telling them not to cry I would fear could backfire into them shutting down and not letting their feelings out at all. I know my answer isn't the popular one, but I wanted offer the other side.