Here's how i think about it OP. Everything's a trade. All your interactions are an exchange of some kind, money for services, talk for networking, touching for companionship, smiling at someone to make them feel better, which itself makes you feel better. And generally trades that make people feel better about themselves are always good, regardless of who they are.
As to your point of feeling lonely, i've felt the same and went through a similarly arduous process of nihilistic depression because i had by myself come upon the notion of ethical egotism, and being someone who had little to no motivation to act in self interest it took me a long time to digest it. But thankfully after a long while i decided that that just wasn't true. Self interest is just one way of reading what's happening, and a particularly faulty one. People put themselves constantly in situations where they act solely in the interest of another person, often because watching someone in distress upsets them enough to act altruistically, and accepting that feeling of letting yourself come to be uncomfortable and drawn to helping someone is acting for the good of others. You let yourself care, you let yourself be drawn to help, you let yourself depend on them. Love basically. Love for those you meet daily, for your SO, for people lacking the skill to act by themselves, for everyone. That's what's deep inside all of us.
It's easier to do this when your self esteem tells you that they're inherently worth more than you. But that doesn't matter. If you know hardship and pain it's easier to be kind to others, and i'd wager that's exactly why it comes so naturally to you. Kindness isn't a weakness.
I always thought, be good. If you're in severe hardship yourself, it doesn't matter. It helps you be even better at helping others. Work on yourself if it can make you better for others as well. Whoever you are, whatever makes you, make it work for the best of others who need it
Somebody better quote this fucking post i swear to god if i wrote this all for nothing i'm quitting the internet.