I guess in the same way that public libraries steal value from book publishers and public education steals value from private tutors. Also, how rainwater steals value from bottled water companies, fresh air steals value from air filter vendors, and sunlight steals value from the electric company.
Libraries still pay for each copy of a book, and in some countries royalties are paid out each time the book is borrowed. The library is not allowed to make additional copies of a book and borrow them either. Public education pays its teachers.
But overall I'm not in disagreement with you, you could say open source is done as part of the greater good and advancement of technology and computer science, and not for personal capital gain. That also means that it isn't meant to be a sustainable career path, or job that you can do full time though.