Excellent writing is one of the primary selling points of some games - but it is by no means necessary. It can even be counterproductive in some situations.
There has been research into what aspects of video games players enjoy the most. One model is Quantic Foundry's Gamer Motivation model. Their research indicates that there are six primary aspects of a game that can draw a gamer in - and each individual player will be interested in some, but not all, of those aspects, depending on their own personalities.
The six motivations are categorized as "Action," "Social," "Mastery," "Acheivement," "Immersion," and "Creativity." Of these six motivations, players tend to be strongly interested in one or two of them.
And of these six motivations, the only one strongly tied to good writing is "Immersion!"
What this means for you is that you need to think about what type of game you're making. Read the article I linked and decide whether immersion should be one of the core focuses of your game or not. Quite frankly, if it isn't, then spending a lot of time on your game's story is a waste and can even potentially drive away the kind of players you want to target. There are in fact gamers out there who find stories to be annoying and want to get straight to the action!
I posted these examples in a comment, but I'll elaborate on them here. Three games with excellent writing are The Beginner's Guide, Undertale, and Bastion. To be maybe a little too honest, all three of these games get me to cry every time I play them because their stories are so powerful. However, this comes at a cost:
- The Beginner's Guide is a walking simulator, meaning that there is no actual gameplay - you walk through levels while the story is narrated to you, but you have no control over what happens, and there are virtually no puzzles to solve or challenges to overcome.
- Undertale does have gameplay. However, one of the very valid criticisms levied against Undertale is that there are long stretches where you're walking around while story is dumped on you, and there's not much to do except slowly walk towards the next area.
- Bastion has relatively weak gameplay (compared to other games as well-received as it). There's not much to it besides fighting mobs of enemies - few puzzles to solve, and most of the enemies start feeling the same after a while.
All three of these games have been received well, but they sacrifice keeping the player in intense action in order to tell a powerful story. This appeals to some players and pushes others away.
In contrast, Thumper, Sonic Mania, and Beat Hazard are three games that effectively do not have stories. In exchange, they drop the player into the action of gameplay almost immediately and have few moments in which the action lets up. This will appeal to a different type of gamer.
In conclusion, you need to decide which type of game you want to make, then decide which aspects of the game need to be focused on the most. Even if you are willing to polish every aspect of your game completely, telling a story almost requires you to take the player out of the action from time to time, which will push some types of players away. There's a tradeoff to be made, and it's important to make a conscious decision where you want your game to fall on that spectrum.