The leading evolutionary hypothesis: our ancestors developed hyper-sensitivity to geosmin (the main compound in petrichor) to locate fresh water after rain. In arid or patchy environments, smelling recent rainfall at parts-per-trillion levels signaled vital resources and fertile soil— a major survival edge.
Sharks got tuned for blood in water; we got tuned for water on land.