I doubt it's just the lack of sex. I'm sure there's an entire litany of other (negative) things going on in the person's life, or events that have impacted them in the past, all of which contribute to their depression.
Well said, it's likely one of many components.
While not important to me, when it comes to sex, it seems like a natural biological need and is the most obvious way to give life meaning (even if not used for reproduction) for every animal. That's the most basic, banal meaning of life thing I can think of. Especially when society, media portrays it as something good and important. If you can't achieve that thing that everybody says is so awesome and amazing, it makes sense that lack of it can make people miserable.
I could say.. I don't understand what is so difficult to understand.
People want different things, for different reasons. Cultural, indocranation, among others. I'm sure you can think of something that is very important to you, something that you like and enjoy, meanwhile others find that thing boring or unimportant. It could be as simple as playing a certain game or certain genre of games. Somebody might find, let's say, roguelikes boring. Or visual novels boring. Same with movies. I enjoy watching some things that other find boring. I watch stuff that portray things which I am missing in my life (for example, meaning of life movies), meanwhile others might have that (meaning) so they have no desire to watch those kind of movies.
I don't understand how people can play roguelikes. I don't understand how people can watch meaning of life movies.
I look at some people, for example those with a lot of money. Why don't they just live your live without hurting others, is it that difficult? Some do, many do. But apparently it is difficult for others. Plenty of people don't care about power or forcing their views on others. Plenty of people don't care about money after a certain amount, meanwhile some never have enough of it.
A homeless person can look at somebody who has a steady job, place to live, food to eat.. and wish they had that, they would be happy.
Meanwhile the person they look up to is miserable with what they have.
We all have different experiences, different issues, different circumstances that shape us and make us crave different things. For some, it is sex, or lack thereof.