In the past two decades, only two of the #1 highest grossing films in Canada and the U.S. were in a genre other than science fiction or fantasy. Of the top five highest grossing films in Canada and the U.S., only one of them, The Dark Knight, was a crime thriller.
Before I get into the nitty-gritty of why this is, it is important to go over some relevant box office terminology for the uninitiated. Luckily, Box Office Mojo has a glossary of terms that we can refer to. The terms I'm going to be focusing on, however, are "gross" and "ticket price inflation". "Gross" refers to a film's earnings at the box office in U.S. dollars. Usually, a film's total gross is split right down the middle and divided among the film's distributors and exhibitors (theatres). "Ticket price inflation" is an estimate of how much money a film would make if it was released in any other year than its initial release.
The only term that isn't defined by Box Office Mojo is "domestic" (as in "domestic box office" or "domestic gross"). The distinction of this term is important, as not a lot of people know exactly what it means. According to the "box office recording" of this Wikipedia article, "domestic" is defined as Canada and the U.S.
Now that I got that out of the way, I can move on to the question of why science fiction and fantasy films are so popular among us Westerners.
It should come as no surprise that the reasons why we gravitate towards science fiction and fantasy are due to either escapism or social commentary. Escapism is easy: life sucks and we need something to distract us from whatever the hell is screwing us over. Take Shrek 2, for example. It's not exactly deep, or influential, by any stretch of the imagination. It's dumb fun meant to cheer us up.
For the social commentary aspect, let's look at a film that's not on the bar graph: Starship Troopers. According to the Nerdist article, 7 Reasons Starship Troopers Was Way Ahead of Its Time, Paul Verhoeven's 1997 satirical cult classic deals with heavy themes such as fascism, the exploitative nature of reality TV, and colonialism. The article states, right at the beginning, "It's an overblown shiny action movie, parodying overblown shiny action movies and every thing they represent."
Like all cult classics, it was met with critical and commercial disdain, but has gained a more positive reception over the years, as audiences and critics have come to recognize what the film is trying to accomplish.
However, there is an elephant in the room that must be addressed: what is the #1 highest grossing film of each year, from 1997-2017, when adjusted for inflation? As mentioned above, "ticket price inflation" is an estimate of how much money a film would make if it was released in any other year than its initial release.
As you can see above, the #1 highest grossing film, when adjusted for inflation, is Titanic. Obviously, Titanic is neither science fiction nor fantasy. However, it is also directed by James Cameron, who is most well-known for his science fiction films. This could possibly give insight as to why it dominates alongside the other sci-fi and fantasy films on the graph.
It should also be noted that, as explained on this Box Office Mojo page, that ticket price inflation isn't an exact science, as it doesn't take into account certain factors, such as the economic conditions at the time, or the amount of films released that year.
Regardless of whether or not certain films are adjusted for inflation, the overwhelming amount of science fiction and fantasy films that have reached the #1 spot each year should be enough proof of both genres' popularity.