Starcraft games have earned more money than whole 40k in its whole history and I am pretty sure Starcraft brand is way more known in the world that WH40k.
The rest about quality of each setting is your opinion.
I'd like some proof of that. Given the ammount of products and decades of existing, I'd say that 40K leaves SC far, far in the dirt, but ok - prove me wrong.
As for the quality, it's really about what you like more - space rednecks or space nazis. I'll go with nazis.
StarCraft Series
StarCraft (including Brood War expansion) 9,500,000 $437,000,000
Starcraft II : Wings of Liberty / Heart of the Swarm / Legacy of the Void 8,600,000 $542,500,000
http://www.statisticbrain.com/blizzard-entertainment-statistics/
Now you find some revenue numbers for WH40k (also these above numbers don't count in all the other stuff like figurines, Tabletop games and others).
Also wiki says: "As of December 2010, the game has sold nearly 4.5 million units"
so probably those numbers above are not even big enough. I doubt with two expansion it only sold additional 4 mil in 6 years when it sold 4.5 in first 6 months. Especially since both expansions sold more than 1 mil in first 24h.