George Lucas has horrible writing ability but can create super interesting worlds that gets people interested to want to learn more about them.
Starwars never had the best story. But has cool characters and cool ideas that gets people interested and want to learn more about the universe.
Compare Darth Vadar, Darth Maul, Palpatine, General Grevious, Boba Fett to anything Star Treck has. Starwars creates characters more memorable then star trek, and alot of it has to do with strong unique memorable features and character design. Darth Vadar is considered one of the best villains ever created.
Starwars has a coolness factor that star track doesn't have. But starwars is plagued with lots of bad movies like the recent sequel trilogy that knocks it down. Episode 3 while a favorite for many people has many cool ideas but not all are executed the best they can because of Lucas poor writing. Padme dying of giving up on life?
Starwars while Inspired by previous works of fiction and based on Samaria, & Hero tales of old and so on, still created something unique in the 70's that you don't really see creativity in Hollywood anymore because money gets involved Hollywood is afraid to take risks so it lead to the same old same old you see now.
Star Treck has better consistency less unecessary series while Starwars has coolness going for it which makes it more popular.