You saying that sexual frustration (physical) isn't as bad as "feeling lonely" (mental). You said you can masturbate the sexual frustration away but you are wrong, at some point even masturbation isn't enough, you'll always be yearning for actual sex now, at points you'll want to kill yourself from the lust because being dead would be easier and masturbation merely takes the edge off for a while but its never enough.
You are speaking as if "feeling unwanted" or "lonely", things related to your ego, are on par with or worse that sexual frustration, now that's ridiculous. Just stop thinking so highly of yourself and all those feelings disappear, but lust never goes away no matter what you do. I have felt bad about being unwanted and lonely, but I just stopped one day because I realized I don't even really want those things, what I want is WHAT THOSE THINGS LEAD TO..... sex
Your lonliness and feelings of being unwanted are basically an extension of your sexual frustration, you've just latched on to the mental aspect. When you start thinking of yourself as nobody, someone who isn't deserving because nobody actually deserves anything, shit just happens in life, then all there is, is the sexual frustration, the physical need, the rest is all in your head, created by your ego, because you think too highly of yourself, you think you "deserve more from life".