I would say Very important, even if it's barely there. I need a framing device and context to enjoy whatever is going on in the game, how does one arrive at a scene, what is the relationship between the characters and character dynamics etc make scenes more enjoyable. And by Important I don't mean it has to be great, but it should not get in the way of the enjoyment of the game, if it's not good it should be transparent. I have tried so many games on this site but end quitting most and putting them off for later because I stumbled upon something annoying.
For example Waifu academy, i like honey select games, it has a lot of content and a lot of girls, and according to many reviews the plot and writing is great. But I couldn't stand it and you can't ignore the plot in that game since it's a on rails type visual novel, so if you don't like a particular aspect of the story or some characters you can't ignore it, you have to go through it to get to the next bit, so for someone who doesn't like the story it becomes grating (I ended up quitting). Compare that to harem hotel, the story is barely there, if you can call it that, although each girl has their own thing going on. But since it's a sandbox type game, if you don't like a girl you can ignore them and do something else if you're not in the mood.
So even though I prefer games with a good story and writing overall, I would rather play a game with passable story as opposed to a game with arguably (based on general opinion) good writing but which doesn't suit my personal preference.