I believe that the oft-used explanation, that people read speculative fiction for "escapism" is somewhat reductive. While it is true that such works focus on otherworldliness, the transportation of our consciousness to settings that are uncannily dissimilar or wildly fantastical compared to our own, the same could arguably be said about historical or realistic fiction novels written from the perspectives of people whose circumstances differ from our own.
In some ways, speculative fiction is less escapist because it does not pretend to be objective. Marshall McLuhan theorized that we are just as affected by our interactions with inanimate objects (particularly media), as we are changed by our interactions with other conscious beings. Scott McCloud goes further with this idea. In his view, literature is not simply a fulfillment of the creator's drives, but also a means by which readers can vicariously confront their own consciousness. He also believes that the stylized use of nonhuman entities (e.g. anthropomorphic animals and aliens) in speculative fiction allows for "universal identification", as well as the formation of connections with others and our sense of humanity*. We read speculative fiction because it allows us to interrogate lofty concepts of morality and humanity in an accessible way. It also makes us feel less alone.
And "escapism" is not the cognitive sedative some people make it out to be. If anything, speculative fiction encourages us to envision what the world could be, rather than what it is. Instead of leading us back into a reality we live with every day, it forces us to reckon with possibilities, with what-ifs and purported impossibilities. Good speculative fiction challenges convention and resists readers' reliance on schemas. It can be a place where people whose existences are characterized by grim struggle can find the hope for a less dark future, and the will to make that future a reality (Afrofuturism is a great example of this).
Lastly, it is pure, unadulterated fun. Even without all the philosophical justifications, I mention above, speculative fiction is simply pleasurable, allowing us to engage with that imaginative sense of wonder that is so often disparaged as "child-like." I mean, there is nothing wrong with the fact that sometimes, we want to watch vampires learning how to use e-mail or digital proxy-people duking it out in a futuristic hellscape where the laws of physics don't apply. Realistic fiction is often so bogged down with being "objectively believable" that it loses sight of its function as entertainment. And just because something is fun does not necessarily mean it is mind-numbing or to be looked down upon.
In a somewhat less charitable interpretation, it could also be said that the trappings of speculative fiction allow the author to elevate their own experiences of alienation or loneliness into something a bit grander. Most people have had lousy romantic experiences or fumbled their first conversation with an attractive person. But what if you could chalk up those feelings of inadequacy to literal aliens? Much less mortifying and more dramatic, isn't it?
*Ursula Le Guin's essay collection "The Language of the Night" is a good read if you are interested in this sort of thing. It does come across a bit archaically heavy-handed in places (too much credit is given to Jung), but it is an interesting read.