In theory, what you say is correct. In practice, when you're face-to-face with these people, chatting and munching on crackers at the holiday party, and you know that you are working hard to make that guy right in front of you rich, it starts to be disconcerting.
Sometimes, even if we are OK doing job X for $Y, we can stop being OK with it if new facts emerge. There is an interesting study with monkeys (http://news.bbc.co.uk/2/hi/science/nature/3116678.stm) where monkeys who would otherwise be OK with completing a task if the reward was a cucumber, got angry and refused to complete the task when they saw other monkeys getting a grape (a better treat for monkeys) for the same task.
Yes, rationally, if you are happy doing job X for $Y, what others get out of your work should not matter, but sometimes our primitive brain objects.
It shouldn't matter whether or not your work is making someone else richer or not. Just because you believe in a corporate environment it has less influence than a startup doesn't change the equation. You're there to do a job and paid to do just that. If you don't enjoy your work, don't feel you're getting paid what you're worth, or feel dissatisfied in any other way, find another job, start your own company, or do something that will make you happy about what you do and how much you earn.
The fact that someone is successful base on you doing your job should never be a reason to be demotivated, especially if you did the exact same job in a big company or elsewhere and don't feel the same way. It's like getting jealous over someone elses' success rather than focusing on your own success, whatever that means to you. I would suggest finding your own happiness, and pursuing that, rather than focus on things that don't matter.