Within the sport, the Olympics are less important than world titles. However, in terms of gaining fans etc., the Olympics is a much better way to do that.
Most people that watch the world championships are already fans or know who the athletes are, so doing well at worlds will not lead to a significant fan following (unless the athlete is new, but either way, the new fans come from the smaller pool of existing figure skating fans). However, many people who never watch sports otherwise will watch the Olympics. So athletes can gain tons of new fans and even more sponsorship etc opportunities. It's a much bigger platform for self-promotion (for lack of a better term). And even for people who will never watch the sport again until the next Olympics, they might still remember the athlete's name. Also, due to the greater association with the country during the Olympics, there will also be a lot more promotion from the country's media (at least for the larger countries). Someone can go from basically unknown to national celebrity just by medalling, doing well etc.
For example, Adam and Mirai had tons of publicity and opportunities that they would never have gotten even if they won the world championships. Virtue and Moir would not have been on Ellen.
but worlds should still be held because it's more important within the sport.