The solution to your first question is to realize that all professional developers have learned from other developer
All professional anything have learned from others: teachers, doctors, lawyers, authors.... It's how society gets better. Business is the engine that powers it (even if indirectly), and money is the fuel that allows it.
There's absolutely no harm in charging for something of value you create because of what you have learned. Besides, you can always give back to the open source community- maybe even moreso if you are in a position to provide a little funding for some projects (because you charged for your product).
The solution to your first question is to realize that all professional developers have learned from other developers. It's a pay it forward system. Someday, someone will look at your code or receive free advice from you that helps that person make a living off of software. That said, if you think you are deeply indebted to a particular person, you could thank that person with a monetary gift or even purchase rights/license to use the code.