Star Wars is more popular because it was created as a straight old fashioned adventure. It benefits from the fact that its was tethered to more historical/timeless archetypes and storytelling. Star Trek was more understated and more reliant on military structures that had fallen out of favor by the time Star wars rolled around. Indeed, on of the things that Trek had going for it in the 60s was that much of its viewing audience had a favorable view of military service and experience with such service. Star wars was about the triumph of rebellion over oppressive authority. That's the world we've been living in ever since.
Star Wars is also more popular because Star Wars was an event. The was very little of it so when you got new product it was BIG news. Star Trek was on television uninterrupted for the better part of 20 years. Even the movies sometimes felt lacking because of the scope of what could be found on TV every week.