A lot of movies are made "backwards" as well. Hayao Miyazaki doesn't even write scripts and usually flies by the seat of his pants. Shaun of the Dead apparently had its plot and dialoge just scribled on a blackboard. A lot of movies already start location scouting and pre production before the script is finished. Movies, videogames, and TV show generally aren't crafted in a logical sequence.
Because a game's story is more than just its written word. You keep saying 'primarily for the story', but story isn't just what's written. You don't watch a movie primarily for the writing either. You watch it for the combination of visual, sound, music, acting, and dialoge, which combined shape the storytelling to be either good or bad (or something you like or dislike). Even games with bad writing can still deliver a good story experience, because the visuals, sound design, and music come together to make you believe in what you're seeing/playing. As much as the dialoge in Resident Evil 2 sucks, the police station becomes a character on its own because of how well the visual and sound design make it work, and this adds to the narrative. And the fact that you as the player are allowed to interact with it adds even more.