That's a rather romantic view of scientific progress but the actual history is not as nice. I think you're forgetting about the rivalry Edison had with Tesla, at the very least. In academia, fighting over who published/made a discovery first (and therefore gets the credit) are depressingly common. (See
https://en.wikipedia.org/wiki/List_of_scientific_priority_di..., which includes Einstein, Marconi, and Tesla). Today, most STEM researchers won't talk about their research results before publication for fear of getting scooped.
Competition is very much alive and well (not to mention quite vicious) even in the pursuit of knowledge.