Whether we’re looking for love or lust, we look for someone with a good sense of humour. Studies of courtship on Tinder and Facebook show that a sense of humour is the most valued quality in a potential mate.

A philosophy of humour as a virtue sheds light on why it’s so important. A virtue is a valuable trait – something that elicits admiration, pride or love. Traditional examples include prudence, honesty, chastity and wisdom. Is a sense of humour comparable to these time-honoured virtues?

Of course, whether you’re looking for casual dates or seeking a life partner will influence what you want in a mate. But research on relationships suggests humour doesn’t just land you that first date or first kiss: it’s also associated with keeping a relationship together.

When we eulogise someone’s life, having a sense of humour still stands out. My own research on obituaries shows that, when reflecting on the life of a loved one, we tend to treasure their capacity to laugh and make others laugh.

Read more: Facebook gets into dating, but there's little scientific evidence online personality matching works

Why are we so serious about not being too serious? One reason is that laughter is enjoyable, and laughing with someone is even more enjoyable. Part of the value of a sense of humour derives from its ability to counter negative emotions with positive ones. We want to be with people who can make us laugh, especially if they can help us laugh at the things and situations that cause us stress, anxiety or despair. But there are lots of ways to enjoy life. Why do people value humour more than, say, being a good cook or owning a beach house?

When we think about having a sense of humour, perhaps the first thing that comes to mind is stand-up comedy, like the routines of Aparna Nancherla and Eddie Izzard. These people are in the business of producing humour, of making people laugh.

But of course, someone needs to be there to consume humour as well, to do the laughing. And in the typical case, humour is also about someone or something: the object of humour. This producer-consumer-object triangle is the matrix in which a sense of humour finds its home.

Though the research on Tinder and Facebook doesn’t draw these distinctions, I think they’re essential to understanding why a sense of humour is so highly valued. To have a good sense of humour, you have to be skilled at occupying each of the corners of the triangle. Someone who can’t make us laugh is deficient in humour. And there’s nothing less attractive than a person who laughs at their own jokes while everyone else sits in stony silence.

Likewise, someone who isn’t able to laugh at the absurdities of life is a humourless boor. Of course, different people find different things laughable. It depends on what you value, what you expect and what you hold sacred.

This explains why we feel so in tune with someone who both laughs when we do and doesn’t laugh when we don’t. The sort of person who finds Holocaust jokes funny and complains about feminist killjoys may not be your type. They certainly aren’t mine. Testing the boundaries of someone’s sense of humour is a shortcut to discovering whether you share their values. People prize a sense of humour in a potential mate because this is one of the best clues to compatibility.

Read more: Why we desire partners who have had relationship experience

The third corner of the triangle is probably the hardest to occupy. In general, it isn’t very fun to be the butt of the joke. But an inability to admit your own faults and laugh at yourself is a sign that you have an over-inflated ego or take yourself too seriously. Someone who can’t take a joke is bad at being the object of humour. They’re unwilling to admit their own foibles and flaws, and therefore unable to correct them. Who would want to be with a jerk like that?

Of course, I don’t want to suggest that the best romantic partners are constantly laughing at themselves, even when the humour is mean-spirited, cruel or just lame. “It was just a joke. Get a sense of humour!” is a common rhetorical ploy in the domination of women and other subordinated groups.

My point is that someone who’s unable to laugh at themselves when a little self-contempt is appropriate is likely to be either an arrogant self-deceiver or a Puritanical saint. Neither makes a good mate. And so it makes perfect sense that, when we look for a partner, we’d rather laugh with the sinners than cry with the saints.