There are plenty of for profit companies around open source software that are venture backed:
Mesos(mesosphere)
Spark(Databricks)
Flink (Data Artisans)
Zeppelin (NFLabs)
Scala (typesafe)
Linux (Red hat)
Hadoop (Horton, Cloudera, MapR)
Elasticsearch (Elastic)
PredictionIO (PredictionIO Inc)
Meteor (Meteor Inc)
Deeplearning4j (My company skymind)
RethinkDB(RethinkDB inc)
Redis (Redis Labs)
Wordpress(Automattic)
Drupal(Acquia)
Docker (docker inc)
Coreos (coreos inc)
NGINX(nginx inc)
and the list goes on!
Acquired companies also include springsource (VMWare) , jboss (redhat), and ansible (redhat)
Lastly, there's open source from companies such as facebook where the goal is likely hiring. By open sourcing internal tools, it's easier to onboard new devs for recruiting. If you like their tools why not work there?
The key distinction people are missing is that these companies don't monetize open source directly. Instead open source is used as a means of building a user base that will indirectly generate revenue in other ways such as support, licensing solutions around or on top of the software (open core), or through some form of consulting.
FOSS such as the GNU software is a different beast where the goal isn't profit.
I think the confusion is: we can all use the software provided by these companies for free (depending on the context/license) without paying them and contribute back in other ways such as bug reports and the like.
The other thing here is individual devs monetizing their singular github repos. There's no reason you can't charge for support or consulting. Radim @ gensim does exactly that and he does fine.
Just because you can git clone a repo doesn't mean you can use it effectively. You typically seek support via community or commercial. There's no reason both can't exist and they both do.
I hope that helps a bit!