It demonstrates how reckless Graysmith has become
One of the subplots in the film is that Graysmith loses his family as a result of his obsession. This scene helps underscore the fact that this was not an undeserved fate.
His wife tolerates his obsession with Zodiac from literally their first date. At first, she finds it intriguing too, but she eventually she loses interest; Graysmith does not. Notably, she is not some kind of stereotypical harpy who cannot tolerate her partner having a hobby in which he is very engrossed -- unfortunately, that's a common theme in fiction; she is not like that.
But consider what he's doing: hunting down a serial killer who operates in their city. A serial killer who does not wish to be found. And he's not being particularly discreet about it, either. There's a scene before this one in which she observes that Graysmith's name and picture were printed in the paper in connection with his dogged hunt for the Zodiac. They later start receiving mysterious phone calls. Graysmith is effectively doing everything he can to bring himself to the attention of a remorseless killer, and endangering his wife and children in the process. She asks him to stop, and he doesn't.
It's kind of amazing that the Zodiac never came to their house to stage some kind of home invasion, to punish and silence Graysmith. It would have been very reasonable for Mrs Graysmith to fear that eventuality.
Then he crosses paths with Bob Vaughn. Evidence suggests that he's getting closer to the killer, so he ought to be thinking about safety. Instead, he lets this complete stranger lure him out to the boonies alone, enters his strange home, and descends into his creepy basement. If Vaughn had indeed been the Zodiac, Graysmith had served himself up on a silver platter.
The scene in Bob's basements suggests that if Dracula himself had offered to reveal Zodiac's identity to Graysmith, but only on the condition that Graysmith first don a leather gimp suit, strap on a ball-gag, and climb into a large heavy trunk in Dracula's underground catacombs, Graysmith would have accepted without a second thought and only become wise to the immediate danger when he heard Dracula lock the trunk with him in it.
Graysmith loses his family because his obsession with Zodiac is so powerful that it blinds him to everything, including his own immediate safety. This scene proves it by briefly suggesting to the audience that Bob might be the killer so that we recognize what Graysmith cannot: that he is literally too obsessed to survive.