I think 40k is more appealing to the younger crowd. I also think the problem is a bit circular, in that when you buy 40k, you know there will be someone to play against. I have seen 40k players by the boatload at every game store I've frequented, and yet have found WFB players to be scarace. If I'm going to spend a boatload of money on a game, I want it to be a game I'll know I'll have opponents for on a regular basis. It's circular in that, new players see people playing 40k and so buy 40k, making that many more 40k players. I imagine the primary sellers of 40k are not sales staff, but friends who get friends to play.
As to why 40k became more popular in the first place, I'd guess it has something to do with the attrativeness of fantasy and sci-fi combined. As has already been said, 40k is Science Fiction with enough fantasy to compel both crowds. Marines are essentially space knights, orks are orks, eldar are elves, ect. What's mroe appealing to the younger crowd, a knight with a lance and a haorse, or a knight with a rapid fire mini-rocket launcher on an armored motocycle?